Font (bold, italic) problems caused by Windows language settings
by Trond Abusdal · in Torque Game Engine · 01/11/2007 (4:56 am) · 2 replies
I don't know how many of you have experienced this problem, but we thought we'd post a note on it anyway.
We've recently experienced the oddest 'bug' when it comes to fonts - On the developer computer the fonts worked fine, and so it seemed on other computers we ran the game on. Suddenly someone noticed that some text-lines disappeared, and it turned out the problem-lines were the ones in ML-boxes with font set to bold or italic -. This worked fine on the developer computer, and we believe it's because the English XP version is installed, which many of the other computers didn't have (we're Norwegian). Tried with Norwegian versions (Arial Fet, Arial Kursiv - Arial Bold, Arial Italic), but only the italic version worked.
In the function WinFont::create we noticed the CreateFont-Win32 API-call - and also the test to see if the font returned was NULL. This should be fine, as the CreateFont documentation says that it will return NULL if the function fails. Apparently, failure from Windows' point of view doesn't involve not finding the font installed - we've tried feeding the function with completely garbage fonts and it still doesn't fail, and all uft-files are created (probably not correctly though). The font is simply not rendered.
We also did font enumeration based on the font-name input, and on our Windows developer computer "Arial Bold" was found, but not on our Norwegian computer. Arial Kursiv was however, when replacing Arial Bold :p
Oh, and this seems to be a problem first in Torque 1.4(.2) (haven't tried 1.5), as using 1.3 will display correctly, even on the Norwegian computer. Unicode-problem maybe? With .uft-files copied from English to Norwegian computer, _some_ of the bold characters show, and some don't. Yay :D
-Trond
We've recently experienced the oddest 'bug' when it comes to fonts - On the developer computer the fonts worked fine, and so it seemed on other computers we ran the game on. Suddenly someone noticed that some text-lines disappeared, and it turned out the problem-lines were the ones in ML-boxes with font set to bold or italic -
In the function WinFont::create we noticed the CreateFont-Win32 API-call - and also the test to see if the font returned was NULL. This should be fine, as the CreateFont documentation says that it will return NULL if the function fails. Apparently, failure from Windows' point of view doesn't involve not finding the font installed - we've tried feeding the function with completely garbage fonts and it still doesn't fail, and all uft-files are created (probably not correctly though). The font is simply not rendered.
We also did font enumeration based on the font-name input, and on our Windows developer computer "Arial Bold" was found, but not on our Norwegian computer. Arial Kursiv was however, when replacing Arial Bold :p
Oh, and this seems to be a problem first in Torque 1.4(.2) (haven't tried 1.5), as using 1.3 will display
-Trond
About the author
#2
-Trond
01/11/2007 (8:55 am)
I already tried copying the .uft-files from the "working" system to the one with the funny results - still some characters were missing. And it looks like the createfont win32-call is made even if the uft-files exist, which kind of suprised me. I'll have to look more into the loading of cached files tomorrow, time to get home :)-Trond
Associate Orion Elenzil
Real Life Plus
they're in common/ui/cache.
- compiled is probably the wrong word, but they're similar to .dso's -
if the .uft file for a given font exists, TGE won't bother asking the system for it.