Restore the exports of the LoadLibrary injection detours.

We do need those to ensure locale independence in DLL injection chaining after all. As a result, this functionality has been lost since 8e4210826152bf84bdca4ab7b753c883a89f9316.
win32_utf8: Add CreateFontIndirect() and CreateFontIndirectEx().
detour_cache_add(): Use a setinel NULL to pass the number of arguments.
Revise detour chaining to use a system similar to MS-DOS interrupt chaining.

It's just another normal day of development. Today, a new set of detours are on the agenda. Everything is working fine, but there is that one instance of duplicated code you'd like to remove, which gets you thinking. "Hm, detour_next() is nice and all, but wouldn't it be cool if we could somehow get a pointer to the next function in a chain...?"

Then, you have an epiphany.

"Wait a moment... Why didn't I just copy the design used for interrupt chaining in MS-DOS?"

And indeed - after rewriting the whole system, everything just feels so much nicer. And you got your pointers.

Wow.

----

So, by reducing these chains to an implicit sequence of function pointers kept separately by every module, we remove the need for a function like detour_next(), fixing *all* the drawbacks of detour chaining in the process:

* No more platform-dependent assembly to explicitly push a variable argument list to functions with a constant parameter list.
* The function pointers now used to continue the chain can be explicitly initialized with a fallback function. Since these are resolved at module initialization, they are therefore guaranteed to work.
* Last but not least, this also gets rid of the hashtable and array lookups on every invocation.
Cleanup.

With all the progress we've made and th143 introducing a new font, that font replacement comment would be slightly out of place now.
TSA: Layout: Only add the original X offset in the final rendering call.
TSA: ANM: Correctly shift the alpha value when blending 16-bit sprites.

Seems like we've never had a test case for this, until we've encountered th07 and std6txt.anm.
Thanks to Jsmdg257 for reporting this issue.
TSA: Layout: Refactor tab command parsing into its own function.

Introducing, at last, a state structure! Well, we had to take this step one day...
TSA: Layout: Don't increment the tab counter if no tab commands were used.

Any tab alignment in tokens that only use font commands is confusing and unintuitive, so let's get rid of it.
Thanks to Kill-o-matic for reporting this issue.
TSA: Layout: Recognize 'l' as a tab command.
TSA: Layout: Refactor layout processing into its own function.

Yup, we're finally about to address that old TODO.
TSA: Layout: Consolidate the parameters to layout_textout_raw().
TSA: Layout: Perform full text layout in GetTextExtent().

Again, thanks to Kill-o-matic for convincing me to ultimately get this done. I really managed to turn this beast of code into something that's undoubtedly prettier.
TSA: Layout: Use custom callback functions to render substrings.

... or none at all. For now, this is mainly to get rid of the unnecessary TextOut() calls when calling GetTextExtent() - which are invisible, but may still impact performance.
In a th14 scenario, this causes roughly 30% less time to be spent on text rendering. During a full run, this amounts to 39ms on my system.
TSA: Layout: Fix an off-by-one error in layout_match().
win32_utf8: Export function level promotion for the CreateFont() family.

Yeah, it feels sort of weird to export these as part of win32_utf8, but hey, thcrap needs that functionality too, this is where it originates, duplication is always bad, and introducing a further library for both win32_utf8 and thcrap to depend on is even worse.
Add function level promotion detours for the CreateFont() family.

Yeah, I suck at inventing new terminology. Just read the comment, it should make more sense then.
textdisp: Split the CreateFont() detour to make use of detour promotion.
textdisp: Correctly explain CreateFont()'s fallback font selection.

It's been almost two years since I started doing Windows Touhou patching, it's about time I actually realized how that function works. -.-
textdisp: Introduce a consistent string representation for LOGFONT structures.

... in line with the upcoming improved font replacement system.