Different platforms have different levels of support of encodings and
often have slight variations. We already have tables for most encoding
with only CJK missing. Full transcoding inclusion allows us to get reliable
encoding results independently of platform. The biggest con is the need for
external tables encoding.dat.
It removes a duplicate table for korean in graphics/korfont.cpp
This is yet incomplete, since it requires the launcher to be configured in the exact same language as the game (e. g. launcher must be set to Japanese for Japanese FM-Towns games or the pause/restart dialog will be empty). This will be fixed in an extra commit.
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.
- COMI adds a y-Offset of 2 in CJK mode.
- The shadowed glyphs are used for all CJK font drawing, not only Korean. Also, the char height has to be adjusted by one pixel for the shadow.
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.
This fixes the bug shown in the fourth row of screenshots in ticket no. 11656 (DIG Asteroid scene). That bug could basically appear in any other scene which uses the xstart offset.
This is basically a hack, but the original does it just like that. It ensures that certain CJK message strings at the bottom of the screen won't get cut off.
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