TextBlock::Typography Property
.NET Framework (current version)
Gets the currently effective typography variations for the contents of this element.
Assembly: PresentationFramework (in PresentationFramework.dll)
Property Value
Type: System.Windows.Documents::Typography^A Typography object that specifies the currently effective typography variations. For a list of default typography values, see Typography.
The Typography property is applicable only to OpenType fonts. A typography variant has no effect on fonts that do not support the variant. For more information on this topic, see Typography in WPF.
The following example shows how to set the Typography attribute of a TextBlock element.
<TextBlock Name="textBlock" Background="AntiqueWhite" Foreground="Navy" FontFamily="Century Gothic" FontSize="12" FontStretch="UltraExpanded" FontStyle="Italic" FontWeight="UltraBold" LineHeight="Auto" Padding="5,10,5,10" TextAlignment="Center" TextWrapping="Wrap" Typography.NumeralStyle="OldStyle" Typography.SlashedZero="True" > <Run Background="LightGreen">Text run 1.</Run> <LineBreak/><Run Background="LightBlue">Text run 2.</Run> <LineBreak/><Run Background="LightYellow">Text run 3.</Run> </TextBlock>
The following example shows how to set the Typography property programmatically.
.NET Framework
Available since 3.0
Available since 3.0
Show: