scummvm/scummvm — pull request #411 by lordhoto (2013-11-18 00:44:08+00:00)
Title: WIP: Add UTF-32 support to Graphics::Font and Wintermute.

As the title suggets this is an ongoing effort to finally be able to use Unicode strings in Wintermute (and maybe other engines). For this an UTF-32 String class U32String has been added to common/. Furthermore, the Graphics::Font API has been updated to be usable with UTF-32 (strings). The TTF font code has also been adapted that it now will load glyphs on demand which will allow it to actually be usefull for displaying any unicode strings. Last but not least, I made an attempt to adapt the Wintermute code to work with this new U32String class.

The code is still WIP for serveral reasons:
- U32String should be documented a bit more (i.e. toUppercase/toLowercase only work on ASCII characters right now)
- U32String's builtin capacity is 32 characters, which means 128 bytes. Maybe we should fine tune this or simply do not allow any builtin capacity here.
- The Wintermute adaptions haven't really been tested. I was only able to test the Kulivoecko demo a bit, but it uses ANSI (which is really CP1252 AFAIK) strings and not UTF-8 ones. Furthermore, it's font seems to miss characters which are used, but that's the same with wine for me. And there's other font related problems in that game it seems...
- The Font API changes to take uint32 instead of byte might cause regressions in code using Font due to sign extension issues. The following engines (apart) Wintermute seem to use Graphics::Font: Groovie, Mohawk, ZVision. As far as I can tell they do not use drawChar directly and thus should be fine but who knows...

At any rate, it would be cool if someone could test the Wintermute changes a bit more or generally look over this (especially the Font subclass adaptions).