1

My new utility is built with C# / .Net 2.0 / WinForms. I don't think I have changed any font settings, so all widgets have the default settings (Microsoft Sans Serif; 8,25pt it appears). Now that it is released, I'm seeing Chinese sites posting screenshots of it. Apparently they get another font. Problem is this font is monospaced and does not fit in the GUI, as you can see in the picture:

enter image description here

Q: What is the proper way to handle this? (and why does it happen?)

rlv-dan
  • 976
  • 1
  • 10
  • 21
  • I should add that the screenshot shows WinXP but I've seen Win7 screenshots with the same problem... – rlv-dan Mar 31 '13 at 12:47
  • 1
    Don't force the user to change their font like Echilon recommends. You just need to layout your controls such that they automatically scale in size to accommodate changes in font and/or DPI. The solution to that problem is given [here](http://stackoverflow.com/questions/196606/supporting-dpi-and-default-font-changes), and involves placing your controls inside of container controls like TableLayoutPanel and FlowLayoutPanel, combined with setting their Anchor and Dock properties appropriately. It's a bit of work, but it does *work*. – Cody Gray - on strike Mar 31 '13 at 13:25

2 Answers2

2

Well, these XP users do not have Microsoft Sans Serif installed on their machine. Hard to guess why, the odds for long-distance troubleshooting multiplied by the age of the operating system multiplied by the likelihood that they paid for the license produces a very small number.

Without the font present, the font mapper uses a fallback font through font linking. A feature that was explicitly designed to pays attention to Eastern Asian locales. For Simplified Chinese, the fallback is SimSun -> PMingLiu -> MS UI Gothic -> Batang. For Traditional Chinese it is PMingLiu -> SimSun -> MS Mincho -> Batang. Documented in this blog post.

Neither SimSun nor PMingLiU produce pretty glyphs for Western characters, as you can tell. And test in, say, Microsoft Word. If you have a good contact with one of these Chinese users then taking a stab at Tahoma instead is worth a shot.

Community
  • 1
  • 1
Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Strange. As I noted in a comment, I've seen screenshots of Vista/7 with the same problem. Considering that MS Sans Serif is default for .Net(?) why is it not installed together with the framework at least? – rlv-dan Mar 31 '13 at 14:27
  • 1
    The .NET installer doesn't install *any* Windows fonts. They come with Windows. – Hans Passant Mar 31 '13 at 14:38
0

I've run in to this myself. I believe it's probably defaulting to that font for those users due to lack of Unicode support in whatever font you set at design time. According to this thread, using the SimSun font might help.

Echilon
  • 10,064
  • 33
  • 131
  • 217