Fog Creek Software
Discussion Board

Asian Font Names

I have recently been working on an Excel addin that will be in use around the world.  In the course of the project, I had to format certain text with the font MS PGothic, a common font used in Japan.  When the users had their windows environment set to display in English, setting the font name to MS PGothic was sufficient to do the job.  However, when the users had their windows environment set to Japanese, the font name was translated into Japanese and I needed to know that translation before I could assign the font.

I was able to solve the immediate problem of assigning the font using a crude workaround, but the problem left me with questions about how the font came to have two names:

1) Is there some sort of a little-known NameFarEast property that fonts have? If so what is it? and
2) Is there an API call that will allow me to identify the translated font name, either by supplying the English name, or by supplying the underlying file name?  After all, if Excel can generate the locally-translated file names for the font list, then might I be able to access the same information?

Any insights? Thanks in advance.

Ran Whittle
Friday, October 24, 2003

Not a complete answer...
The font resource for many East Asian languages has two names: an English name and a localized name. For Windows 95, Windows 98, and Windows NT 4, the localized name only works on a system locale that matches the language, while the English name works on all other system locales. On Windows 2000 and Windows XP, both names will be valid for any locale. On the earlier operating systems, this can be a problem when programmatically selecting a font. The best method is to try one name and, if that fails, try the other.

The Windows API calls EnumFonts, EnumFontFamilies, and EnumFont–FamiliesEx each return the English font face name if the system locale does not match the language of the font.

Philip Dickerson
Friday, October 24, 2003

*  Recent Topics

*  Fog Creek Home