标签字体不支持日文字符时,Label控件如何正确显示日文字符? [英] How can Label control display Japanese characters properly when font of the label doesn't support Japanese characters?

查看:147
本文介绍了标签字体不支持日文字符时,Label控件如何正确显示日文字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用.Net 4.5目标框架开发Winform应用程序.

I am working on winform application with .Net 4.5 target framework.

我注意到一件事,如果我在Label控件上以日语显示文本,而标签(Arial)的Font不支持日语字符,那么Label也可以成功显示那些字符.

One thing I have noticed that if I display text in Japanese language on Label control while Font of label (Arial) is not supporting Japanese characters, then too Label can successfully display those characters.

如果我在分配日语文本之前和之后检查标签的字体属性,它只会显示"Arial",因此字体可能不会动态更改.

If I check font property of the label before and after assigning Japanese text to it, it shows me "Arial" only, so probably fonts are not dynamically changing.

Label具有哪些内部功能可以实现此目标?

What internal functionality Label have which enables it to achieve this ?

推荐答案

关于字体后备广告.
系统功能,与国际字体管理.它自动选择用户在应用程序中选择的字体以外的其他字体,以表示使用中的字体无法处理的字形.
另请参见:国际字体枚举和选择

About Font fallback.
System feature, tied to the International Font Management. It automates the selection of a font other than the font selected by the user in an application, to represent glyphs that the font in use can't handle.
See also: International Font Enumeration and Selection

可以在系统注册表中找到预定义的字体替换的选择:

A selection of predefined font substitues can be found in the System Registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink

在此处报告有关RichTextBox/RichEdit控件的示例和一些注释:
某些键会更改我的RichTextBox字体

An example and some notes, in relation to the RichTextBox/RichEdit control, are reported here:
Some keys change my RichTextBox font

该控件是使用 EM_SETLANGOPTIONS 设置创建的 IMF_AUTOFONT 选项.
预定义行为,当当前字体无法显示Unicode子集时,这是自动字体回退.文本选择报告字体替换参考.

The control is created with EM_SETLANGOPTIONS set to the IMF_AUTOFONT option.
The predefined behaviour, when an Unicode subset cannot be displayed by the current font, it's an automatic font fallback. The text selection reports the font substitute reference.

可以使用 Unicode选择字体替换默认映射未返回直接匹配时的子集位域.

任何字体替换都与当前系统语言和可用的已安装字体有关.系统专门安装了多种字体来支持此功能.后备字体通常在系统字体存储库中(在Windows中为\Windows\Fonts)标记为隐藏".可以使用工具栏按钮或上下文菜单中的Show命令将它们标记为可用/可枚举.
(Arial Unicode在其中).

Any font subsitution is in relation with the current system language and the available installed fonts. A number of fonts is specifically installed by the System to support this feature. The fallback font are usually marked as "Hidden" in the System Font repository (\Windows\Fonts in Windows). These can be marked as usable/enumerable, using the Show command in the toolbar button or contextual menu.
(Arial Unicode is among these).

另请参阅:

国际字体和文本显示
关于多语言用户界面
使用字体后退
Uniscribe

International Fonts and Text Display
About Multilingual User Interface
Using Font Fallback
Uniscribe

这篇关于标签字体不支持日文字符时,Label控件如何正确显示日文字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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