问题描述
我正在开发一个以 .Net 4.5 作为目标框架的 Windows 窗体应用程序.
I am working on a Windows Forms application, with .Net 4.5 as target framework.
我注意到的一件事是,如果我在 Label
控件上显示日语文本,而标签 (Arial) 的 Font
不支持日语字符,那么 >标签
可以成功显示那些字符.
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 substitutes can be found in the System Registry:
HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindows NTCurrentVersionFontLinkSystemLink
此处报告了与 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 中为 WindowsFonts
).这些可以标记为可用/可枚举,使用工具栏按钮或上下文菜单中的 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 (WindowsFonts
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
这篇关于当使用的字体不支持这种语言时,标签控件如何正确显示日文字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!