संपादित करें

इसके माध्यम से साझा किया गया


Typography.StylisticAlternates Property

Definition

Gets or sets a value that specifies the index of a stylistic alternates form.

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

Property Value

The index of the stylistic alternates 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.

Alternates are glyphs that can be substituted for a standard glyph. OpenType fonts, such as the Pericles font used in the following examples, contain alternate glyphs that you can use to create different appearances for text. The following text displays standard glyphs for the Pericles font.

Text using OpenType standard glyphs
Example of standard set of glyphs

The Pericles OpenType font contains additional glyphs that provide stylistic alternates to the standard set of glyphs. The following text displays stylistic alternate glyphs.

Text using OpenType stylistic alternate glyphs
Example of stylistic alternate glyphs

The following code example shows how to define stylistic alternate glyphs for the Pericles font, using the StylisticAlternates property.

<Paragraph FontFamily="Pericles">
  <Run Typography.StylisticAlternates="1">A</Run>NCIENT
  GR<Run Typography.StylisticAlternates="1">EE</Run>K
  MYTH<Run Typography.StylisticAlternates="1">O</Run>LOGY
</Paragraph>

The following text displays several other stylistic alternate glyphs for the Pericles font.

Text using OpenType stylistic alternate glyphs
Example of other stylistic alternate glyphs

The following code example shows how to define these other stylistic alternate glyphs.

<Paragraph FontFamily="Pericles">
  <Run Typography.StylisticAlternates="1">A</Run>
  <Run Typography.StylisticAlternates="2">A</Run>
  <Run Typography.StylisticAlternates="3">A</Run>
  <Run Typography.StylisticAlternates="1">C</Run>
  <Run Typography.StylisticAlternates="1">E</Run>
  <Run Typography.StylisticAlternates="1">G</Run>
  <Run Typography.StylisticAlternates="1">O</Run>
  <Run Typography.StylisticAlternates="1">Q</Run>
  <Run Typography.StylisticAlternates="1">R</Run>
  <Run Typography.StylisticAlternates="2">R</Run>
  <Run Typography.StylisticAlternates="1">S</Run>
  <Run Typography.StylisticAlternates="1">Y</Run>
</Paragraph>

XAML Attribute Usage

<object Typography.StylisticAlternates="int"/>

Dependency Property Information

Identifier field StylisticAlternatesProperty
Metadata properties set to true AffectsMeasure, AffectsRender, Inherits

Applies to

See also