Windows Dev Center

Expand Minimize

Typography.NumeralStyle attached property

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


<object Typography.NumeralStyle="fontNumeralStyleMemberName"/>

XAML Values

fontNumeralStyleMemberName

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

Remarks

Microsoft OpenType fonts support an old style numeral format. This format is useful for displaying numerals in styles that are no longer standard.

To set this attached property value in code, use the SetNumeralStyle method. To get this attached property value in code, use the GetNumeralStyle 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 (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.UI.Xaml.Documents

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

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:
© 2015 Microsoft