Редагувати

Поділитися через


Typography.NumeralStyle Property

Definition

Gets or sets a FontNumeralStyle enumerated value that determines the set of glyphs that are used to render numeric alternate font forms.

public:
 property System::Windows::FontNumeralStyle NumeralStyle { System::Windows::FontNumeralStyle get(); void set(System::Windows::FontNumeralStyle value); };
public System.Windows.FontNumeralStyle NumeralStyle { get; set; }
member this.NumeralStyle : System.Windows.FontNumeralStyle with get, set
Public Property NumeralStyle As FontNumeralStyle

Property Value

A FontNumeralStyle enumerated value. The default value is Normal.

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.

OpenType fonts support an old style numeral format. This format is useful for displaying numerals in styles that are no longer standard. The following text displays an 18th century date in standard and old style numeral formats for the Palatino Linotype font.

Text using OpenType old style numerals
Example of standard and old style numerals

The following text displays standard numerals for the Palatino Linotype font, followed by old style numerals.

Text using OpenType old style numeral sets
Example of standard and old style numeral sets

The following code example shows how to define old style numerals for the Palatino Linotype font, using the NumeralStyle property.

<Paragraph FontFamily="Palatino Linotype">
  <Run Typography.NumeralStyle="Normal">1234567890</Run>
  <Run Typography.NumeralStyle="OldStyle">1234567890</Run>
</Paragraph>

XAML Attribute Usage

<object Typography.NumeralStyle="FontNumeralStyle"/>

Dependency Property Information

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

Applies to

See also