Редагувати

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


Typography.NumeralAlignment Property

Definition

Gets or sets a FontNumeralAlignment enumerated value that indicates the alignment of widths when using numerals.

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

Property Value

A FontNumeralAlignment 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 a proportional and tabular figure feature to control the alignment of widths when using numerals. Proportional figures treat each numeral as having a different width - "1" is narrower than "5". Tabular figures are treated as equal-width numerals so that they align vertically, which increases the readability of financial type information.

The following text displays two proportional figures in the first column using the Miramonte font. Note the difference in width between the numerals "5" and "1". The second column shows the same two numeric values with the widths adjusted by using the tabular figure feature.

Text using OpenType proportional & tabular figures
Example of proportional and tabbed figures

The following code example shows how to define proportional and tabular figures for the Miramonte font, using the NumeralAlignment property.

<TextBlock FontFamily="Miramonte">
  <Run Typography.NumeralAlignment="Proportional">114,131</Run>
</TextBlock>
<TextBlock FontFamily="Miramonte">
  <Run Typography.NumeralAlignment="Tabular">114,131</Run>
</TextBlock>

XAML Attribute Usage

<object Typography.NumericalAlignment="FontNumeralAlignment"/>

Dependency Property Information

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

Applies to

See also