East Asian Font Names....

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....

Japanese (1041)

English Name Localized Name
MS UI Gothic (N/A)
Arphic Gyokailenmentai Heavy JIS AR行楷連綿体H
Arphic Gyokailenmentai Light JIS AR行楷連綿体L
HG??????M-PRO HG丸ゴシックM-PRO
HG????-PRO HG正楷書体-PRO
MS PR2???? MS PR2ゴシック
MS PR???? MS PRゴシック
HG?????E-PRO HGゴシックE-PRO
HG???? HG正楷書体
MS PGothic MS Pゴシック
MS PMincho MS P明朝
MS Gothic MS ゴシック
MS Mincho MS 明朝


Korean (1042)

English Name Localized Name
GulimChe 굴림체
BatangChe 바탕체
DotumChe 돋움체
GungsuhChe 궁서체
Batang 바탕
Gulim 굴림
Dotum 돋움
Gungsuh 궁서
Ami R 휴먼아미체
HYPMokGak-Bold HY목각파임B
HYShortSamul-Medium HY얕은샘물M
HYPost-Medium HY엽서M
Headline R 휴먼둥근헤드라인
Pyunji R 휴먼편지체
HYGothic-Extra HY견고딕
HYSinMun-MyeongJo HY신문명조
HYMyeongJo-Extra HY견명조
HYTaJa-Medium HY타자M
Headline Sans R 휴먼각진헤드라인
Yet R 휴먼옛체


Simplified Chinese (2052)

English Name Localized Name
SimSun 宋体
SimHei 黑体
FangSong_GB2312 仿宋_GB2312
KaiTi_GB2312 楷体_GB2312
YouYuan 幼圆
STSong 华文宋体
STZhongsong 华文中宋
STKaiti 华文楷体
STFangsong 华文仿宋
STXihei 华文细黑
STLiti 华文隶书
STXingkai 华文行楷
STXinwei 华文新魏
STHupo 华文琥珀
STCaiyun 华文彩云
FZYaoTi 方正姚体简体
FZShuTi 方正舒体简体
NSimSun 新宋体
LiSu 隶书
MS Hei (N/A)
MS Song (N/A)


Traditional Chinese (1028)

English Name Localized Name
PMingLiu 新細明體
MingLiu 細明體
DFLiHeiBold(P) 華康儷粗黑
DFLiHeiBold 華康新儷粗黑
DFKai-SB 標楷體


# Rosyna on 26 Feb 2005 5:50 PM:

And this is why you don't use these kinds of names when storing references to fonts. You use the PostScript name instead. For one, it is much less likely to duplicate over multiple fonts.

For instance, an English name for one font and the Japanese name for another might be identical. When the Japanese names or English names themselves are different.

# Guy Smith-Ferrier on 16 Mar 2005 4:39 AM:

Michael,

You said "For prior versions of Windows, the only practical solution is to try one font, then if that attempt fails to try the other". I'm not so sure. I run the following code on Japanese Windows 98 SE with the .NET Framework 1.1:-

Font font = new Font("MS Mincho", 12);

It executes just fine and I get the MS Mincho font. It's true that the font name is in Japanese and not English but this is also true for Windows XP Pro SP2. My point is that it doesn't fail and it is ok to use the MS Mincho English font name on both XP and 98 in both English and Japanese versions.

Guy

# Michael Kaplan on 16 Mar 2005 4:53 AM:

Hi Guy,

Interesting! This does not of course work outside of the Japanese version (I have tested that much), although it does in XP, and I believd it also fails with Win95 and NT3.51/NT4. Interesting that it has been at least partially working since Win98J, though!

# Guy Smith-Ferrier on 17 Mar 2005 4:34 AM:

Michael,

I'm curious on a couple of points:-

(1) You said "For prior versions of Windows, the only practical solution is to try one font, then if that attempt fails to try the other". What are you meaning by "fails" ? If you create a font using a non-existant font name like this:-

Font font = new Font("DoesntExist", 12);

the .NET framework doesn't throw an exception because the font mapping mechanism will always attempt to get a match no matter what.

(2) How are you able to test this on the Japanese version of Windows NT 4 ? The .NET Framework requires IE6 which requires NT4 SP6 but there is no Japanese NT4 SP6. Have I missed it ? Do you have an internal release of Japanese NT4 SP6 ? Did you install the English SP6 onto a Japanese NT4 ?

Guy

# Michael Kaplan on 17 Mar 2005 5:46 AM:

I am not just talking about the .NET Framework here -- this advice relates to VB <= 6.0, C/C++ of any version, etc. It is not just a framework thing....

# Guy Smith-Ferrier on 17 Mar 2005 5:58 AM:

Ah, ok, I understand.

# 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:

Actually, if you look here for unmanaged code and here for managed code, you'll see I have already answered the only way to get the names....


Please consider a donation to keep this archive running, maintained and free of advertising.
Donate €20 or more to receive an offline copy of the whole archive including all images.

referenced by

2011/09/13 "It was an honest mistake -- I'm not running NT4; I'm just in Hong Kong!"

2010/03/30 A modest proposal

2008/10/28 Ready... set... Reboot Redux, part Deux!

2008/07/11 On installing and removing fonts, Part 4: The easiest part is the addition!

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