Microsoft Sans Serif Font not used in Chinese Localized Windows
Scenario:
A UI Interface element appears to use a different font on US English Windows 7 Enterprise compared to "Chinese" Windows 7 Enterprise even with all localization packs and languages set to English. In the WinForms codebehind, the FontFamily is not explicitly defined and relies on the defaults.
English:
Chinese:
Several questions:
1) What is the font used in the Chinese Windows?
2) What is different about such an install that would cause it to use that font? 3) How do I set up an environment to replicate this? Is it an install time option on Windows 7 that one does not get when switching UI and System Culture on an already installed Windows 7 instance?FWIW:
I checked C:\Windows\Fonts and it has the same version and siz开发者_如何学Ce of "Microsoft Sans Serif Regular"
If you haven't done anything to your fonts, default font fall-back mechanism would probably use SimSun as a font replacement for your standard font.
The reason why font is replaced, is that default font on Chinese OS needs to display Chinese characters. And of course due to sheer size, MS Sans Serif does not have Chinese glyphs defined.
To avoid the problem, you might want to "hardcode" font information in resource files – usually simple size modification (i.e. setting 9 instead 8.25) helps. Please be aware, however that if you do that, Chinese characters might appear corrupted – if I recall it correctly it will turn-off font fall-back mechanism completely. It might be appropriate for "static" UI elements that are not going to be translated to Chinese but would be totally unacceptable for text boxes and similar controls which allow users to enter free-form text.
Instead of fighting the rendering issues, it is best to just let it pass. I am sure that Chinese users are simply used to that specific look & feel.
精彩评论