Skip to main content
.NET Framework Class Library
Typography Class

Provides access to a rich set of OpenType typography properties.

Inheritance Hierarchy
SystemObject
  System.Windows.DocumentsTypography

Namespace:   System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)
Syntax
Public NotInheritable Class Typography
public sealed class Typography
public ref class Typography sealed
[<[%$TOPIC/ms522971_en-us_VS_110_2_0_3_0_0%]>]
type Typography =  class end

The Typography type exposes the following members.

Properties
  NameDescription
Public property AnnotationAlternatesGets or sets a value that specifies the index of an alternate annotation form.
Public property CapitalsGets or sets a FontCapitals enumerated value that indicates the capital form of the selected font.
Public property CapitalSpacingGets or sets a value that determines whether inter-glyph spacing for all-capital text is globally adjusted to improve readability.
Public property CaseSensitiveFormsGets or sets a value that determines whether glyphs adjust their vertical position to better align with uppercase glyphs.
Public property ContextualAlternatesGets or sets a value that determines whether custom glyph forms can be used based upon the context of the text being rendered.
Public property ContextualLigaturesGets or sets a value that determines whether contextual ligatures are enabled.
Public property ContextualSwashesGets or sets a value that specifies the index of a contextual swashes form.
Public property DiscretionaryLigaturesGets or sets a value that determines whether discretionary ligatures are enabled.
Public property EastAsianExpertFormsGets or sets a value that determines whether the standard Japanese font forms have been replaced with the corresponding preferred typographic forms.
Public property EastAsianLanguageGets or sets a FontEastAsianLanguage enumerated value that indicates the version of glyphs to be used for a specific writing system or language.
Public property EastAsianWidthsGets or sets a FontEastAsianWidths enumerated value that indicates the proportional width to be used for Latin characters in an East Asian font.
Public property FractionGets or sets a FontFraction enumerated value that indicates the fraction style.
Public property HistoricalFormsGets or sets a value that determines whether historical forms are enabled.
Public property HistoricalLigaturesGets or sets a value that indicates whether historical ligatures are enabled.
Public property KerningGets or sets a value that indicates whether kerning is enabled.
Public property MathematicalGreekGets or sets a value that indicates whether standard typographic font forms of Greek glyphs have been replaced with corresponding font forms commonly used in mathematical notation.
Public property NumeralAlignmentGets or sets a FontNumeralAlignment enumerated value that indicates the alighnment of widths when using numerals.
Public property NumeralStyleGets or sets a FontNumeralStyle enumerated value that determines the set of glyphs that are used to render numeric alternate font forms.
Public property SlashedZeroGets or sets a value that indicates whether a nominal zero font form should be replaced with a slashed zero.
Public property StandardLigaturesGets or sets a value that indicates whether standard ligatures are enabled.
Public property StandardSwashesGets or sets a value that specifies the index of a standard swashes form.
Public property StylisticAlternatesGets or sets a value that specifies the index of a stylistic alternates form.
Public property StylisticSet1Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet10Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet11Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet12Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet13Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet14Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet15Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet16Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet17Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet18Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet19Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet2Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet20Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet3Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet4Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet5Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet6Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet7Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet8Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property StylisticSet9Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public property VariantsGets or sets a FontVariants enumerated value that indicates a variation of the standard typographic form to be used.
Top
Methods
  NameDescription
Public method Equals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public method Static member GetAnnotationAlternatesReturns the value of the AnnotationAlternates attached property for a specified dependency object.
Public method Static member GetCapitalsReturns the value of the Capitals attached property for a specified dependency object.
Public method Static member GetCapitalSpacingReturns the value of the CapitalSpacing attached property for a specified dependency object.
Public method Static member GetCaseSensitiveFormsReturns the value of the CaseSensitiveForms attached property for a specified dependency object.
Public method Static member GetContextualAlternatesReturns the value of the ContextualAlternates attached property for a specified dependency object.
Public method Static member GetContextualLigaturesReturns the value of the ContextualLigatures attached property for a specified dependency object.
Public method Static member GetContextualSwashesReturns the value of the ContextualSwashes attached property for a specified dependency object.
Public method Static member GetDiscretionaryLigaturesReturns the value of the DiscretionaryLigatures attached property for a specified dependency object.
Public method Static member GetEastAsianExpertFormsReturns the value of the EastAsianExpertForms attached property for a specified dependency object.
Public method Static member GetEastAsianLanguageReturns the value of the EastAsianLanguage attached property for a specified dependency object.
Public method Static member GetEastAsianWidthsReturns the value of the EastAsianWidths attached property for a specified dependency object.
Public method Static member GetFractionReturns the value of the Fraction attached property for a specified dependency object.
Public method GetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public method Static member GetHistoricalFormsReturns the value of the HistoricalForms attached property for a specified dependency object.
Public method Static member GetHistoricalLigaturesReturns the value of the HistoricalLigatures attached property for a specified dependency object.
Public method Static member GetKerningReturns the value of the Kerning attached property for a specified dependency object.
Public method Static member GetMathematicalGreekReturns the value of the MathematicalGreek attached property for a specified dependency object.
Public method Static member GetNumeralAlignmentReturns the value of the NumeralAlignment attached property for a specified dependency object.
Public method Static member GetNumeralStyleReturns the value of the NumeralStyle attached property for a specified dependency object.
Public method Static member GetSlashedZeroReturns the value of the SlashedZero attached property for a specified dependency object.
Public method Static member GetStandardLigaturesReturns the value of the StandardLigatures attached property for a specified dependency object.
Public method Static member GetStandardSwashesReturns the value of the StandardSwashes attached property for a specified dependency object.
Public method Static member GetStylisticAlternatesReturns the value of the StylisticAlternates attached property for a specified dependency object.
Public method Static member GetStylisticSet1Returns the value of the StylisticSet1 attached property for a specified dependency object.
Public method Static member GetStylisticSet10Returns the value of the StylisticSet10 attached property for a specified dependency object.
Public method Static member GetStylisticSet11Returns the value of the StylisticSet11 attached property for a specified dependency object.
Public method Static member GetStylisticSet12Returns the value of the StylisticSet12 attached property for a specified dependency object.
Public method Static member GetStylisticSet13Returns the value of the StylisticSet13 attached property for a specified dependency object.
Public method Static member GetStylisticSet14Returns the value of the StylisticSet14 attached property for a specified dependency object.
Public method Static member GetStylisticSet15Returns the value of the StylisticSet15 attached property for a specified dependency object.
Public method Static member GetStylisticSet16Returns the value of the StylisticSet16 attached property for a specified dependency object.
Public method Static member GetStylisticSet17Returns the value of the StylisticSet17 attached property for a specified dependency object.
Public method Static member GetStylisticSet18Returns the value of the StylisticSet18 attached property for a specified dependency object.
Public method Static member GetStylisticSet19Returns the value of the StylisticSet19 attached property for a specified dependency object.
Public method Static member GetStylisticSet2Returns the value of the StylisticSet2 attached property for a specified dependency object.
Public method Static member GetStylisticSet20Returns the value of the StylisticSet20 attached property for a specified dependency object.
Public method Static member GetStylisticSet3Returns the value of the StylisticSet3 attached property for a specified dependency object.
Public method Static member GetStylisticSet4Returns the value of the StylisticSet4 attached property for a specified dependency object.
Public method Static member GetStylisticSet5Returns the value of the StylisticSet5 attached property for a specified dependency object.
Public method Static member GetStylisticSet6Returns the value of the StylisticSet6 attached property for a specified dependency object.
Public method Static member GetStylisticSet7Returns the value of the StylisticSet7 attached property for a specified dependency object.
Public method Static member GetStylisticSet8Returns the value of the StylisticSet8 attached property for a specified dependency object.
Public method Static member GetStylisticSet9Returns the value of the StylisticSet8 attached property for a specified dependency object.
Public method GetTypeGets the Type of the current instance. (Inherited from Object.)
Public method Static member GetVariantsReturns the value of the Variants attached property for a specified dependency object.
Public method Static member SetAnnotationAlternatesSets the value of the AnnotationAlternates attached property for a specified dependency object.
Public method Static member SetCapitalsSets the value of the Capitals attached property for a specified dependency object.
Public method Static member SetCapitalSpacingSets the value of the CapitalSpacing attached property for a specified dependency object.
Public method Static member SetCaseSensitiveFormsSets the value of the CaseSensitiveForms attached property for a specified dependency object.
Public method Static member SetContextualAlternatesSets the value of the ContextualAlternates attached property for a specified dependency object.
Public method Static member SetContextualLigaturesSets the value of the ContextualLigatures attached property for a specified dependency object.
Public method Static member SetContextualSwashesSets the value of the ContextualSwashes attached property for a specified dependency object.
Public method Static member SetDiscretionaryLigaturesSets the value of the DiscretionaryLigatures attached property for a specified dependency object.
Public method Static member SetEastAsianExpertFormsSets the value of the EastAsianExpertForms attached property for a specified dependency object.
Public method Static member SetEastAsianLanguageSets the value of the EastAsianLanguage attached property for a specified dependency object.
Public method Static member SetEastAsianWidthsSets the value of the EastAsianWidths attached property for a specified dependency object.
Public method Static member SetFractionSets the value of the Fraction attached property for a specified dependency object.
Public method Static member SetHistoricalFormsSets the value of the HistoricalForms attached property for a specified dependency object.
Public method Static member SetHistoricalLigaturesSets the value of the HistoricalLigatures attached property for a specified dependency object.
Public method Static member SetKerningSets the value of the Kerning attached property for a specified dependency object.
Public method Static member SetMathematicalGreekSets the value of the MathematicalGreek attached property for a specified dependency object.
Public method Static member SetNumeralAlignmentSets the value of the NumeralAlignment attached property for a specified dependency object.
Public method Static member SetNumeralStyleSets the value of the NumeralStyle attached property for a specified dependency object.
Public method Static member SetSlashedZeroSets the value of the SlashedZero attached property for a specified dependency object.
Public method Static member SetStandardLigaturesSets the value of the StandardLigatures attached property for a specified dependency object.
Public method Static member SetStandardSwashesSets the value of the StandardSwashes attached property for a specified dependency object.
Public method Static member SetStylisticAlternatesSets the value of the StylisticAlternates attached property for a specified dependency object.
Public method Static member SetStylisticSet1Sets the value of the StylisticSet1 attached property for a specified dependency object.
Public method Static member SetStylisticSet10Sets the value of the StylisticSet10 attached property for a specified dependency object.
Public method Static member SetStylisticSet11Sets the value of the StylisticSet11 attached property for a specified dependency object.
Public method Static member SetStylisticSet12Sets the value of the StylisticSet12 attached property for a specified dependency object.
Public method Static member SetStylisticSet13Sets the value of the StylisticSet13 attached property for a specified dependency object.
Public method Static member SetStylisticSet14Sets the value of the StylisticSet14 attached property for a specified dependency object.
Public method Static member SetStylisticSet15Sets the value of the StylisticSet15 attached property for a specified dependency object.
Public method Static member SetStylisticSet16Sets the value of the StylisticSet16 attached property for a specified dependency object.
Public method Static member SetStylisticSet17Sets the value of the StylisticSet17 attached property for a specified dependency object.
Public method Static member SetStylisticSet18Sets the value of the StylisticSet18 attached property for a specified dependency object.
Public method Static member SetStylisticSet19Sets the value of the StylisticSet19 attached property for a specified dependency object.
Public method Static member SetStylisticSet2Sets the value of the StylisticSet2 attached property for a specified dependency object.
Public method Static member SetStylisticSet20Sets the value of the StylisticSet20 attached property for a specified dependency object.
Public method Static member SetStylisticSet3Sets the value of the StylisticSet3 attached property for a specified dependency object.
Public method Static member SetStylisticSet4Sets the value of the StylisticSet4 attached property for a specified dependency object.
Public method Static member SetStylisticSet5Sets the value of the StylisticSet5 attached property for a specified dependency object.
Public method Static member SetStylisticSet6Sets the value of the StylisticSet6 attached property for a specified dependency object.
Public method Static member SetStylisticSet7Sets the value of the StylisticSet7 attached property for a specified dependency object.
Public method Static member SetStylisticSet8Sets the value of the StylisticSet8 attached property for a specified dependency object.
Public method Static member SetStylisticSet9Sets the value of the StylisticSet9 attached property for a specified dependency object.
Public method Static member SetVariantsSets the value of the Variants attached property for a specified dependency object.
Public method ToStringReturns a string that represents the current object. (Inherited from Object.)
Top
Fields
  NameDescription
Public field Static member AnnotationAlternatesPropertyIdentifies the AnnotationAlternates attached property.
Public field Static member CapitalSpacingPropertyIdentifies the CapitalSpacing attached property.
Public field Static member CapitalsPropertyIdentifies the Capitals attached property.
Public field Static member CaseSensitiveFormsPropertyIdentifies the CaseSensitiveForms attached property.
Public field Static member ContextualAlternatesPropertyIdentifies the ContextualAlternates attached property.
Public field Static member ContextualLigaturesPropertyIdentifies the ContextualLigatures attached property.
Public field Static member ContextualSwashesPropertyIdentifies the ContextualSwashes attached property.
Public field Static member DiscretionaryLigaturesPropertyIdentifies the DiscretionaryLigatures attached property.
Public field Static member EastAsianExpertFormsPropertyIdentifies the EastAsianExpertForms attached property.
Public field Static member EastAsianLanguagePropertyIdentifies the EastAsianLanguage attached property.
Public field Static member EastAsianWidthsPropertyIdentifies the EastAsianWidths attached property.
Public field Static member FractionPropertyIdentifies the Fraction attached property.
Public field Static member HistoricalFormsPropertyIdentifies the HistoricalForms attached property.
Public field Static member HistoricalLigaturesPropertyIdentifies the HistoricalLigatures attached property.
Public field Static member KerningPropertyIdentifies the Kerning attached property.
Public field Static member MathematicalGreekPropertyIdentifies the MathematicalGreek attached property.
Public field Static member NumeralAlignmentPropertyIdentifies the NumeralAlignment attached property.
Public field Static member NumeralStylePropertyIdentifies the NumeralStyle attached property.
Public field Static member SlashedZeroPropertyIdentifies the SlashedZero attached property.
Public field Static member StandardLigaturesPropertyIdentifies the StandardLigatures attached property.
Public field Static member StandardSwashesPropertyIdentifies the StandardSwashes attached property.
Public field Static member StylisticAlternatesPropertyIdentifies the StylisticAlternates attached property.
Public field Static member StylisticSet10PropertyIdentifies the StylisticSet10 attached property.
Public field Static member StylisticSet11PropertyIdentifies the StylisticSet11 attached property.
Public field Static member StylisticSet12PropertyIdentifies the StylisticSet12 attached property.
Public field Static member StylisticSet13PropertyIdentifies the StylisticSet13 attached property.
Public field Static member StylisticSet14PropertyIdentifies the StylisticSet14 attached property.
Public field Static member StylisticSet15PropertyIdentifies the StylisticSet15 attached property.
Public field Static member StylisticSet16PropertyIdentifies the StylisticSet16 attached property.
Public field Static member StylisticSet17PropertyIdentifies the StylisticSet17 attached property.
Public field Static member StylisticSet18PropertyIdentifies the StylisticSet18 attached property.
Public field Static member StylisticSet19PropertyIdentifies the StylisticSet19 attached property.
Public field Static member StylisticSet1PropertyIdentifies the StylisticSet1 attached property.
Public field Static member StylisticSet20PropertyIdentifies the StylisticSet20 attached property.
Public field Static member StylisticSet2PropertyIdentifies the StylisticSet2 attached property.
Public field Static member StylisticSet3PropertyIdentifies the StylisticSet3 attached property.
Public field Static member StylisticSet4PropertyIdentifies the StylisticSet4 attached property.
Public field Static member StylisticSet5PropertyIdentifies the StylisticSet5 attached property.
Public field Static member StylisticSet6PropertyIdentifies the StylisticSet6 attached property.
Public field Static member StylisticSet7PropertyIdentifies the StylisticSet7 attached property.
Public field Static member StylisticSet8PropertyIdentifies the StylisticSet8 attached property.
Public field Static member StylisticSet9PropertyIdentifies the StylisticSet9 attached property.
Public field Static member VariantsPropertyIdentifies the Variants attached property.
Top
Remarks

The Typography object exposes the set of features that an OpenType font supports. By setting the properties of Typography in markup or code, you can easily author documents that take advantage of OpenType features.

The following text displays standard capital letters for the Pescadero font, followed by the letters styled as "SmallCaps" and "AllSmallCaps". In this case, the same font size is used for all three words.

Text using OpenType capitals

Text using OpenType capitals

The following markup example shows how to define capitals for the Pescadero font, using properties of the Typography object. When the "SmallCaps" format is used, any leading capital letter is ignored.

<Paragraph FontFamily="Pescadero" FontSize="48">
  <Run>CAPITALS</Run>
  <Run Typography.Capitals="SmallCaps">Capitals</Run>
  <Run Typography.Capitals="AllSmallCaps">Capitals</Run>
</Paragraph>

The following code example accomplishes the same task as the previous markup example.

			MyParagraph.FontFamily = New FontFamily("Pescadero")
			MyParagraph.FontSize = 48

			Dim run_1 As New Run("CAPITALS ")
			MyParagraph.Inlines.Add(run_1)

			Dim run_2 As New Run("Capitals ")
			run_2.Typography.Capitals = FontCapitals.SmallCaps
			MyParagraph.Inlines.Add(run_2)

			Dim run_3 As New Run("Capitals")
			run_3.Typography.Capitals = FontCapitals.AllSmallCaps
			MyParagraph.Inlines.Add(run_3)

			MyParagraph.Inlines.Add(New LineBreak())
MyParagraph.FontFamily = new FontFamily("Pescadero");
MyParagraph.FontSize = 48;

Run run_1 = new Run("CAPITALS ");
MyParagraph.Inlines.Add(run_1);

Run run_2 = new Run("Capitals ");
run_2.Typography.Capitals = FontCapitals.SmallCaps;
MyParagraph.Inlines.Add(run_2);

Run run_3 = new Run("Capitals");
run_3.Typography.Capitals = FontCapitals.AllSmallCaps;
MyParagraph.Inlines.Add(run_3);

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

Typography Properties

The following table lists the properties, values, and default value of the Typography object.

Property

Value(s)

Default Value

AnnotationAlternates

Numeric value – byte

0

Capitals

AllPetiteCaps | AllSmallCaps | Normal | PetiteCaps | SmallCaps | Titling | Unicase

FontCapitals. Normal

CapitalSpacing

Boolean

false

CaseSensitiveForms

Boolean

false

ContextualAlternates

Boolean

true

ContextualLigatures

Boolean

true

ContextualSwashes

Numeric value - byte

0

DiscretionaryLigatures

Boolean

false

EastAsianExpertForms

Boolean

false

EastAsianLanguage

HojoKanji | Jis04 | Jis78 | Jis83 | Jis90 | NlcKanji | Normal | Simplified | Traditional | TraditionalNames

FontEastAsianLanguage. Normal

EastAsianWidths

Full | Half | Normal | Proportional | Quarter | Third

FontEastAsianWidths. Normal

Fraction

Normal | Slashed | Stacked

FontFraction. Normal

HistoricalForms

Boolean

false

HistoricalLigatures

Boolean

false

Kerning

Boolean

true

MathematicalGreek

Boolean

false

NumeralAlignment

Normal | Proportional | Tabular

FontNumeralAlignment. Normal

NumeralStyle

Boolean

FontNumeralStyle. Normal

SlashedZero

Boolean

false

StandardLigatures

Boolean

true

StandardSwashes

numeric value – byte

0

StylisticAlternates

numeric value – byte

0

StylisticSet1

Boolean

false

StylisticSet2

Boolean

false

StylisticSet3

Boolean

false

StylisticSet4

Boolean

false

StylisticSet5

Boolean

false

StylisticSet6

Boolean

false

StylisticSet7

Boolean

false

StylisticSet8

Boolean

false

StylisticSet9

Boolean

false

StylisticSet10

Boolean

false

StylisticSet11

Boolean

false

StylisticSet12

Boolean

false

StylisticSet13

Boolean

false

StylisticSet14

Boolean

false

StylisticSet15

Boolean

false

StylisticSet16

Boolean

false

StylisticSet17

Boolean

false

StylisticSet18

Boolean

false

StylisticSet19

Boolean

false

StylisticSet20

Boolean

false

Variants

Inferior | Normal | Ordinal | Ruby | Subscript | Superscript

FontVariants. Normal

All dependency properties of this class also have an attached property usage in XAML. For instance, you can set the AnnotationAlternates property through this syntax: <object Typography.AnnotationAlternates="value".../>

Examples

The following code sample shows the use typographic Capitals in XAML. Notice that the variant feature is applied to all text contained with the Paragraph element.

<FlowDocument FontFamily="Palatino Linotype" FontSize="24">
  <Paragraph Typography.Capitals="SmallCaps">
    This example shows the use of the Capitals property
    of the Typography object. The entirety of this paragraph
    is displayed in small capitals letters,
    except for the first letter of a sentence,
    and where an uppercase letter is used. In these cases,
    a large capital letter is used.
  </Paragraph>
</FlowDocument>

The following code sample shows the use typographic Capitals and NumeralStyle features in XAML. Notice that both typographic properties are applied to the entire paragraph.

<FlowDocument FontFamily="Palatino Linotype" FontSize="24">
    <Paragraph Typography.Capitals="SmallCaps" Typography.NumeralStyle="OldStyle">
      Welcome to C#! . . . 14<LineBreak/>
      Working with Variables, Operators, and Expressions . . . 29<LineBreak/>
      Writing Methods and Applying Scope . . . 45
    </Paragraph>
</FlowDocument>
Version Information

.NET Framework

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

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.

Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.