Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

TextBox.Typography Property

Gets the currently effective typography variations for the text contents of the text box.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)
public Typography Typography { get; }

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 about this topic, see Typography in WPF.

The following example shows how to set the Typography attribute, using Paragraph as the example element.

  FontFamily="Palatino Linotype"
    This text has some altered typography characteristics.  Note
    that use of an open type font is necessary for most typographic
    properties to be effective.
    0123456789 10 11 12 13
    1/2 2/3 3/4

The following figure shows how this example renders.

Screenshot: Text with altered typography

In contrast, the following figure shows how a similar example with default typographic properties renders.

Screenshot: Text with altered typography

The following example shows how to set the Typography property programmatically.

Paragraph par = new Paragraph();

Run runText = new Run(
    "This text has some altered typography characteristics.  Note" +
    "that use of an open type font is necessary for most typographic" +
    "properties to be effective.");
Run runNumerals = new Run("0123456789 10 11 12 13");
Run runFractions = new Run("1/2 2/3 3/4");

par.Inlines.Add(new LineBreak());
par.Inlines.Add(new LineBreak());
par.Inlines.Add(new LineBreak());
par.Inlines.Add(new LineBreak());

par.TextAlignment = TextAlignment.Left;
par.FontSize = 18;
par.FontFamily = new FontFamily("Palatino Linotype");

par.Typography.NumeralStyle = FontNumeralStyle.OldStyle;
par.Typography.Fraction = FontFraction.Stacked;
par.Typography.Variants = FontVariants.Inferior;

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
© 2014 Microsoft. All rights reserved.