Expand Minimize

Typography.NumeralAlignment attached property

Applies to Windows and Windows Phone

Gets or sets a FontNumeralAlignment value that indicates the alignment of widths for numerals.


<object Typography.NumeralAlignment="fontNumeralAlignmentMemberName"/>

XAML Values

fontNumeralAlignmentMemberName

A named constant of the FontNumeralAlignment enumeration, for example Normal.

Remarks

Microsoft 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.

To set this attached property value in code, use the SetNumeralAlignment method. To get this attached property value in code, use the GetNumeralAlignment method.

Examples

This XAML example illustrates some of the possible FontNumeralStyle and FontNumeralAlignment values that can be applied to text elements using the Typography attached properties.


<Grid>
  <Grid.RowDefinitions>
    <RowDefinition Height="20"/>
    <RowDefinition Height="150"/>
    <RowDefinition Height="150"/>
    <RowDefinition/>
    <RowDefinition/>
   </Grid.RowDefinitions>
   <Grid.ColumnDefinitions>
     <ColumnDefinition Width="100"/>
     <ColumnDefinition Width="150"/>
     <ColumnDefinition Width="150"/>
   </Grid.ColumnDefinitions>
   <TextBlock Grid.Row="0" Grid.Column="1" FontFamily="Segoe"
      Foreground="#2a2a2a" Text="Lining" HorizontalAlignment="Center"/>
   <TextBlock Grid.Row="0" Grid.Column="2" FontFamily="Segoe"
      Foreground="#2a2a2a" Text="Old-Style" HorizontalAlignment="Center"/>
   <TextBlock Grid.Row="1" Grid.Column="0" FontFamily="Segoe"
     Foreground="#2a2a2a" Text="Proportional" VerticalAlignment="Center"/>
   <TextBlock Grid.Row="2" Grid.Column="0" FontFamily="Segoe"
     Foreground="#2a2a2a" Text="Tabular" VerticalAlignment="Center"/>
   <TextBlock Grid.Row="1" Grid.Column="1" FontFamily="Segoe"
     Foreground="#2a2a2a" FontSize="25" Typography.NumeralStyle="Lining"
     Typography.NumeralAlignment="Proportional" HorizontalAlignment="Center"
     VerticalAlignment="Center" TextAlignment="Right">
     409,280<LineBreak/>
     367,112<LineBreak/>
     155,068<LineBreak/>
     171,792
   </TextBlock>
   <TextBlock Grid.Row="1" Grid.Column="2" FontFamily="Segoe"
     Foreground="#2a2a2a" FontSize="25" Typography.NumeralStyle="OldStyle"
     Typography.NumeralAlignment="Proportional" HorizontalAlignment="Center"
     VerticalAlignment="Center" TextAlignment="Right">
     409,280<LineBreak/>
     367,112<LineBreak/>
     155,068<LineBreak/>
     171,792
    </TextBlock>
   <TextBlock Grid.Row="2" Grid.Column="1" FontFamily="Segoe"
     Foreground="#2a2a2a" FontSize="25" Typography.NumeralStyle="Lining"
     Typography.NumeralAlignment="Tabular" HorizontalAlignment="Center"
     VerticalAlignment="Center" TextAlignment="Right">
     409,280<LineBreak/>
     367,112<LineBreak/>
     155,068<LineBreak/>
     171,792
   </TextBlock>
   <TextBlock Grid.Row="2" Grid.Column="2" FontFamily="Segoe"
     Foreground="#2a2a2a" FontSize="25" Typography.NumeralStyle="OldStyle"
     Typography.NumeralAlignment="Tabular" HorizontalAlignment="Center"
     VerticalAlignment="Center" TextAlignment="Right">
     409,280<LineBreak/>
     367,112<LineBreak/>
     155,068<LineBreak/>
     171,792
   </TextBlock>
 </Grid>

Requirements

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.UI.Xaml.Documents

Metadata

Windows.winmd

See also

Typography

 

 

Show:
© 2014 Microsoft