by Michael S. Kaplan, published on 2005/02/26 08:11 -05:00, original URI: http://blogs.msdn.com/b/michkap/archive/2005/02/26/380867.aspx
TrueType fonts under Win32 support multiple names, stored as resources inside the font file. This name is then used to identify the font in code. That resource string, like all resources, is read according to the machine's language settings. As anyone who understands localization will realize, this is very bad since it means that the functionality is changing when the language does (this string is not only used for display, it is used for programmatic purposes as well!). The font should be made to either accept only one name worldwide, or all names worldwide.... not to accept a different name depending on the machine's locale.
Fortunately, very few languages have ever taken advantage of this "feature" of font files.
Unfortunately, most Asian fonts do take advantage of it.
Thankfully, Windows 2000, XP, and Server 2003 have fixed the problem to the point where they will accept either name. For prior versions of Windows, the only practical solution is to try one font, then if that attempt fails to try the other. Thus, the list. :-)
This table is provided to give you both the English name and the localized name -- the latter will work only on that specific locale, and the former will work on every locale but that specific one. Feel free to use this information in your own applications that need to use specific fonts for East Asian data on different locales, on downlevel platforms.
Note: The question marks that appear in the English list of font names below is intentional. Due to what can only be considered really bad design decisions, these fonts were given Asian names for non-Asian locales (and such characters always become question marks when the resource file is not a Unicode one. Oops!!!). The ones marked in red do not exist -- in other words the font has but one name, which in this case is a good thing....
|MS UI Gothic
|Arphic Gyokailenmentai Heavy JIS
|Arphic Gyokailenmentai Light JIS
|Headline Sans R
# Rosyna on 26 Feb 2005 5:50 PM:
# Guy Smith-Ferrier on 16 Mar 2005 4:39 AM:
# Michael Kaplan on 16 Mar 2005 4:53 AM:
# Guy Smith-Ferrier on 17 Mar 2005 4:34 AM:
# Michael Kaplan on 17 Mar 2005 5:46 AM:
# Guy Smith-Ferrier on 17 Mar 2005 5:58 AM:
# Louis Z. D. on 14 Apr 2008 8:10 AM:
I'm working on an file import module, this module from the file transform text elements to our format. In the file there are text objects, of which font names are localized (witten with Japanese Unicode signes). In our application there is a font list and my goal is to determine font indices. The font list contains english font names.
My question is, is there any Win32 routine, which can determine the english font name by its localized name?
I see now two opportunities:
First: Hard code the previous assign list to our program.
Second: I've read about EnumFontFamilies which enumerates installed or supported font names. If the current system locale is equivalent with the locale of the font created, it returns the locale font name. Could it be possible to enumerate through the system locales and after set them enumerate the installed languages, and make a list in which the localized font name could be assigned to it's english correspondence? I think this wouldn't work satisfyable, what do you think?
Thank you, in advance
# Michael S. Kaplan on 14 Apr 2008 8:23 AM:
2010/03/30 A modest proposal
2008/10/28 Ready... set... Reboot Redux, part Deux!
2006/10/21 Is Font.FontFamily localized?
2006/02/13 Getting all of the localized names of a font
2005/12/12 Ready... set... Reboot Redux
go to newer or older post, or back to index or month or day