Typography.StandardLigatures 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置一个值,该值指示是否启用标准连字。
public:
property bool StandardLigatures { bool get(); void set(bool value); };
public bool StandardLigatures { get; set; }
member this.StandardLigatures : bool with get, set
Public Property StandardLigatures As Boolean
属性值
如果启用了标准连字,则为 true
;否则为 false
。 默认值是 true
。
注解
此属性获取或设置拥有 Typography
属性的对象上的值,这是访问类实例的唯一 Typography 方法。 此外,此属性支持附加属性用法,以便可以在 XAML 中包含文本的对象上设置此属性。
以下文本显示 Pericles 字体的标准连字字形。
标准连字集的示例
下面的代码示例演示如何使用 StandardLigatures 属性为 Pericles 字体定义标准连字字形。
<Paragraph FontFamily="Pericles" Typography.StandardLigatures="True">
<Run Typography.StylisticAlternates="1">FI</Run>
<Run Typography.StylisticAlternates="1">FL</Run>
<Run Typography.StylisticAlternates="1">TH</Run>
<Run Typography.StylisticAlternates="1">TT</Run>
<Run Typography.StylisticAlternates="1">TV</Run>
<Run Typography.StylisticAlternates="1">TW</Run>
<Run Typography.StylisticAlternates="1">TY</Run>
<Run Typography.StylisticAlternates="1">VT</Run>
<Run Typography.StylisticAlternates="1">WT</Run>
<Run Typography.StylisticAlternates="1">YT</Run>
</Paragraph>
默认情况下,WPF 中的 OpenTypes 字体启用标准连字。 例如,如果使用 Palatino Linotype 字体,则标准连字“fi”、“ff”和“fl”显示为组合字符字形。 请注意,每个标准连字的字符对之间彼此相连。
默认启用的标准连字示例
但是,可禁用标准连字功能,从而使“ff”等标准连字显示为两个单独的字形,而不显示为一个组合字符字形。
禁用的标准连字示例
下面的代码示例演示如何使用 StandardLigatures 属性禁用 Palatino Linotype 字体的标准连字字形。
<!-- Set standard ligatures to false in order to disable feature. -->
<Paragraph Typography.StandardLigatures="False" FontFamily="Palatino Linotype" FontSize="72">
fi ff fl
</Paragraph>
如果 is 和所选字体的值StandardLigaturestrue
不支持标准连字,则会显示字母的默认格式。
XAML 属性用法
<object Typography.StandardLigatures="bool"/>
依赖项属性信息
标识符字段 | StandardLigaturesProperty |
元数据属性设置为 true |
AffectsMeasure、AffectsRender、Inherits |