Typography.ContextualSwashes 属性

定义

获取或设置一个值,该值指定上下文花体格式的索引。Gets or sets a value that specifies the index of a contextual swashes form.

public:
 property int ContextualSwashes { int get(); void set(int value); };
public int ContextualSwashes { get; set; }
member this.ContextualSwashes : int with get, set
Public Property ContextualSwashes As Integer

属性值

标准花体格式的索引。The index of the standard swashes form. 默认值为 0(零)。The default value is 0 (zero).

注解

此属性获取或设置一个值,在拥有的对象上Typography属性,它是唯一的方法来访问Typography类实例。This property gets or sets a value on the object that owns a Typography property, which is the only way to access a Typography class instance. 此外,此属性支持,因此它可以包含文本的设置的附加的属性用法中的对象XAMLXAMLIn addition, this property supports an attached property usage so that it can be set on text-containing objects in XAMLXAML.

花体字形的某些组合可能导致文本外观欠佳,例如相邻字母的下行处出现重叠。Certain combinations of swash glyphs can cause an unattractive appearance, such as overlapping descenders on adjacent letters. 通过连接形式花体,可使用能生成更佳外观的替代花体字形。Using a contextual swash allows you to use a substitute swash glyph that produces a better appearance. 以下文本显示同一单词应用连接形式花体前后的外观。The following text shows the same word before and after a contextual swash is applied.

使用 OpenType 花体的文本Text using OpenType contextual swashes
上下文花体连字的示例Example of a contextual swash

下面的代码示例演示如何定义 Pescadero 字体的花使用ContextualSwashes属性。The following code example shows how to define a contextual swash for the Pescadero font, using the ContextualSwashes property.

<Paragraph FontFamily="Pescadero" Typography.StandardSwashes="1">
  Lyon <Run Typography.ContextualSwashes="1">L</Run>yon
</Paragraph>

XAML 属性用法XAML Attribute Usage

<object Typography.ContextualSwashes="int"/><object Typography.ContextualSwashes="int"/>

依赖项属性信息Dependency Property Information

标识符字段Identifier field ContextualSwashesProperty
元数据属性设置为 trueMetadata properties set to true AffectsMeasure, AffectsRender, InheritsAffectsMeasure, AffectsRender, Inherits

适用于

另请参阅