This change works on both CE6 and CE7 platforms. On both platforms, only the arialuni.ttf font file supports this language, so both font mappers now always return us a reference to the desired font.
I modified the LOGFONT structure content to include asking for the Japanese character set (LOGFONT.lfCharSet = SHIFTJIS_CHARSET). On our CE7 platform, though, font mapper mapped the request to the tahoma.ttf file. This always returned us a reference to the arialuni.ttf font on our CE6 platform. By default, the character set requested was ANSI_CHARSET (0). Initially, we only specified the character height, weight, and the font family name. This call uses a LOGFONT structure that we populate with the attributes of a font we want, and behind the scenes, the system's font mapper component looks through the fonts of which it's aware and returns the one that it thinks is the best match. Our program calls CreateFontIndirect() to obtain a handle to a GDI font resource that we can select into the screen's device context when drawing text to the screen. The default tahoma.ttf built into CE7 does support eastern-European character sets but not far-East character sets. Something about the OS images allowed font mapper under CE6 to map our requests correctly, but not under CE7.
ARIAL UNICODE MS ARIALUNI.TTF WINDOWS
This version of arialuni.ttf is indeed compatible with Windows Compact 7. Am I wrong about Tahoma and it's now supporting eastern-European languages?.Is there something you have to build into the OS image to add support for far east languages to make this type of font loading and text drawing work?.Is this arialuni.ttf compatible with Windows Compact 7?.There are already several other true-type fonts installed, so that option (and not raster fonts) is already in our OS build. Arialuni.ttf supports pretty much every language we're likely to support, and it's already the one and only one we use for non-western-European languages. I would rather not add or use other fonts. The registry says that the default system font is Tahoma, but I didn't think Tahoma supports anything other than basic western-European languages. What's odd is that our supported eastern-European languages (Russian, Czech, Bulgarian) appear correctly on Windows Compact 7 whether or not I load arialuni.ttf. This is exactly the same thing that works under CE6.
ARIAL UNICODE MS ARIALUNI.TTF CODE
I've debugged through the code to verify thatĪ) The OS claims that the font is actually loaded into the system fonts list via AddFontResource(),ī) The OS claims that the font loads into the screen device context before actually drawing the text, andĬ) The actual far east characters are in the buffer I hand off to DrawText(). I'm using the same code for both platforms, and the same font file. I get empty boxes instead of the actual characters appearing on the screen, something I've seen when the font doesn't support the necessary character set.
The same technique does not produce far east characters on the screen under Windows Compact 7. Under windows CE 6, I use AddFontResource() to load arialuni.ttf (Arial Unicode MS, version 1.0.1) into the system font list, and all our supported far east languages (Japanese, Korean, Simplified, and Traditional Chinese) appear correctly when the text draws to the screen using the font.