Some fixes from disasm to have the text look pixel-exact like the original.
Some lines in COMI are still off a bit by 2 pixels to the left or to the right. Whilst I doubt that anyone would notice it I'll try to fix that, too.
I have confirmed that this type of shadow (one shadow pixel to the left, one to the right and one to the bottom) is drawn for all CJK characters in COMI.
CJK text in DIG was 2 pixels off vertically due to 4b13c33b.
COMI actually has a y-offset of 2 (not 7) for CJK fonts, but it is applied at a different location.
- Flag 8 is just for the subtitles. This is actually handled correctly in line 538/539.
- Flag 4 is for the wrapping. Most cases I have seen set both 4 and 8, so the visible changes are subtle.
- fix character spacing, vertical placement, clipping etc.
- in particular I rewrote SmushFont::drawStringWrap() and modified getStringWidth() and getStringHeight() to match COMI disasm (fully compatible with DIG, but a bit nicer)
- this actually also fixes some slightly misplaced English (or other standard font language) strings
All CJK versions use the same shading. The original code hardly ever diverges for the different languages (mostly for accessing the character bitmap data from the font files).
The Dig Steam/mac uses LF instead of CRLF for end of line.
This fixes display of subtitles in that version. This also fixes the crash
described in bug #6796.
On some systems, passing signed chars to macros like isspace() etc. lead
to a runtime error. Hence, mark these macros as forbidden by default,
and introduce otherwise equivalent alternatives for them.
This reverts commit d6f7e59336, and
marks the issue with a FIXME. The problem is that it not only skips the malloc,
but also the other code in that block.
MKID_BE relied on unspecified behavior of the C++ compiler,
and as such was always a bit unsafe. The new MKTAG macro
is slightly less elegant, but does no longer depend on the
behavior of the compiler.
Inspired by FFmpeg, which has an almost identical macro.