Chinese characters are rendering in bold

送分小仙女□ 提交于 2019-12-20 07:13:31

问题


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

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.

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.


回答1:


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



来源:https://stackoverflow.com/questions/6754602/chinese-characters-are-rendering-in-bold

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!