Typography.ContextualSwashes Property

Definition

Gets or sets a value that specifies the index of a contextual swashes form.

C#
public int ContextualSwashes { get; set; }

Property Value

The index of the standard swashes form. The default value is 0 (zero).

Remarks

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. In addition, this property supports an attached property usage so that it can be set on text-containing objects in XAML.

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.

Text using OpenType contextual swashes Example of a contextual swash

The following code example shows how to define a contextual swash for the Pescadero font, using the ContextualSwashes property.

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

XAML Attribute Usage

<object Typography.ContextualSwashes="int"/>

Dependency Property Information

Item Value
Identifier field ContextualSwashesProperty
Metadata properties set to true AffectsMeasure, AffectsRender, Inherits

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

See also