gpt4 book ai didi

.net - WPF 如何决定对缺失字符使用哪种字体?

转载 作者:行者123 更新时间:2023-12-03 09:02:37 27 4
gpt4 key购买 nike

我知道 WPF 的默认字体是 Segoei UI。例如,该字体没有中文字符的字形。因此,当用户输入如下所示的文本时,它如何检测应该使用哪种字体来正确呈现它们。它是否检查每个字符的范围并找到包含这些字符的字体,或者它是否在内部使用某种包含大多数 Unicode 字符的字体?

Example text containing characters of multiple cultures

最佳答案

WPF 中的这种机制称为 Font Fallback

Font Fallback

Font fallback refers to the automatic substitution of a font other than the font that is selected by the client application. There are two primary reasons why font fallback is invoked:

  • The font that is specified by the client application does not exist on the system.

  • The font that is specified by the client application does not contain the glyphs that are required to render text.

In WPF, the font fallback mechanism uses the default fallback font family, "Global User Interface", as the substitute font. This font is defined as a composite font, whose file name is "GlobalUserInterface.CompositeFont". For more information about composite fonts, see the Composite Fonts section in this topic.

(如果您询问是因为想要更改后备字体,链接的文章包含作为 WPF 一部分的默认后备字体列表以及有关如何手动设置后备字体的说明。)

这里有几个 Fonts created by Microsoft for specific charsets :

Segoe UI includes Latin, Greek, Cyrillic, and Arabic characters. There are new fonts, also optimized for ClearType, created for other character sets and uses. These include Meiryo for Japanese, Malgun Gothic for Korean, Microsoft JhengHei for Chinese (Traditional), Microsoft YaHei for Chinese (Simplified), Gisha for Hebrew, and Leelawadee for Thai, and the ClearType Collection fonts designed for document use.

Full list of System-Fonts you can use

关于.net - WPF 如何决定对缺失字符使用哪种字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49251386/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com