汉字以粗体显示 [英] Chinese characters are rendering in bold

查看:134
本文介绍了汉字以粗体显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Silverlight在文本框中显示的汉字很少用粗体显示.此文本框上未设置字体系列.请参考以下屏幕截图

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

在上面的屏幕截图中,第一个字符比另一个字符大胆.一个MSDN帖子说这是由于字体系列问题,设置SimSun字体系列应该可以解决该问题.这是应用字体系列后的屏幕截图.

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实际上已解决了该问题.但是我不确定这是否是正确的解决方法,因为我的应用程序允许以任何语言(而不仅仅是中文)输入数据.因此,我不想将字体系列设置为中文字体.

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.

我想知道,由于数据是Unicode(UTF16)编码的,因此呈现引擎应该选择正确的字体并正确呈现它,对吗?

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.

在.NET3.5中使用Silverlight 3.

Using Silverlight 3 with .NET3.5.

推荐答案

问题在于字体本身的描述.您的默认字体(取决于您的计算机)可能是Arial,它可能无法很好地呈现某些中文字符. SimSun是一种用于呈现汉字的字体,因此就像基于拉丁的字体倾向于很好地呈现英文一样,SimSun可以使汉字更好地呈现.

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包含用于国际化文本字段(例如yours)的Unicode字体列表.也许尝试一下其中的一些,直到找到满足您需求的解决方案.

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

这篇关于汉字以粗体显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆