Typography.DiscretionaryLigatures 属性

定义

获取或设置一个值,该值确定是否启用自由连字。

public:
 property bool DiscretionaryLigatures { bool get(); void set(bool value); };
public bool DiscretionaryLigatures { get; set; }
member this.DiscretionaryLigatures : bool with get, set
Public Property DiscretionaryLigatures As Boolean

属性值

如果启用自由连字,则为 true;否则为 false。 默认值是 false

注解

此属性获取或设置拥有 Typography 属性的对象上的值,这是访问类实例的唯一 Typography 方法。 此外,此属性支持附加属性用法,以便可以在 XAML 中对包含文本的对象进行设置。

任意连字设计为可观赏性,而不是专为可读性而设计。 以下文本显示 Pericles 字体的自由连字字形。

使用 OpenType 任意连字
任意连字集的示例

下面的代码示例演示如何使用 DiscretionaryLigatures 属性为 Pericles 字体定义自由连字字。

<Paragraph FontFamily="Pericles" Typography.DiscretionaryLigatures="True">
  <Run Typography.StylisticAlternates="1">CO</Run>
  <Run Typography.StylisticAlternates="1">LA</Run>
  <Run Typography.StylisticAlternates="1">LE</Run>
  <Run Typography.StylisticAlternates="1">LI</Run>
  <Run Typography.StylisticAlternates="1">LL</Run>
  <Run Typography.StylisticAlternates="1">LO</Run>
  <Run Typography.StylisticAlternates="1">LU</Run>
</Paragraph>

XAML 属性用法

<objectTypography.DiscretionaryLigatures=“bool”/>

依赖项属性信息

标识符字段 DiscretionaryLigaturesProperty
元数据属性设置为 true AffectsMeasure, AffectsRender, Inherits

适用于

另请参阅