0

Silverlight renders few Chinese characters as Bold in a text box. This textbox has no font family set on it. Please refer to the following screenshot

Chinese character showing in bold

In the above screenshot, first character is bolder than the other. One of the MSDN posts says that this is because of the font family problem and setting SimSun font family should fix the problem. Here is the screenshot after the applying the font family.

Simsun font family fixing it

It looks like setting SimSun is actually fixing the issue. But I am not sure if this is the correct fix as my application allows to enter data in any language and not just Chinese. So I don't want to set font family to Chinese font.

I am wondering, since the data is Unicode (UTF16) encoded, the rendering engine should take care of choosing the correct font and render it properly right?

I am looking for proper ways to fix this problem. Any suggestions would be helpful.

Using Silverlight 3 with .NET3.5.

Navaneeth K N
  • 15,295
  • 38
  • 126
  • 184
  • You have a crappy font installed that volunteered to render the glyph. Poorly. In general, make the point size bigger. Pretty essential when you support Eastern Asian language. – Hans Passant Jul 19 '11 at 23:17

1 Answers1

5

The problem is with the font's description of itself. Your default font, depending on your computer, is likely Arial, which may not render some Chinese characters very nicely. SimSun is a font that is designed to render Chinese characters, so just like Latin-based fonts tend to render English nicely, SimSun renders Han characters nicer.

Wikipedia has a list of Unicode fonts that are meant for internationalized text fields such as yours. Maybe give a few of them a try until you find one that meets your needs.

http://en.wikipedia.org/wiki/Unicode_typeface#List_of_Unicode_fonts

Jordan
  • 31,971
  • 6
  • 56
  • 67
  • I'd expect the rendering engine to be smart enough to detect language a choose a default font for that language. Isn't that the case? If it can't find the font, may be fall back to Arial or whatever other default font. – Navaneeth K N Jul 19 '11 at 22:09
  • That's definitely possible for sure, but I'm not sure. It's likely better to be explicit, since you don't know what's included on the user's system either. Another piece of the problem is that your font is very small for rendering asian glyphs, so increasing the size may help you some. – Jordan Jul 20 '11 at 00:13