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

Typography Class

Provides access to a rich set of OpenType typography properties.

System.Object
  System.Windows.Documents.Typography

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)
public sealed class Typography

The Typography type exposes the following members.

  NameDescription
Public propertyAnnotationAlternatesGets or sets a value that specifies the index of an alternate annotation form.
Public propertyCapitalsGets or sets a FontCapitals enumerated value that indicates the capital form of the selected font.
Public propertyCapitalSpacingGets or sets a value that determines whether inter-glyph spacing for all-capital text is globally adjusted to improve readability.
Public propertyCaseSensitiveFormsGets or sets a value that determines whether glyphs adjust their vertical position to better align with uppercase glyphs.
Public propertyContextualAlternatesGets or sets a value that determines whether custom glyph forms can be used based upon the context of the text being rendered.
Public propertyContextualLigaturesGets or sets a value that determines whether contextual ligatures are enabled.
Public propertyContextualSwashesGets or sets a value that specifies the index of a contextual swashes form.
Public propertyDiscretionaryLigaturesGets or sets a value that determines whether discretionary ligatures are enabled.
Public propertyEastAsianExpertFormsGets or sets a value that determines whether the standard Japanese font forms have been replaced with the corresponding preferred typographic forms.
Public propertyEastAsianLanguageGets or sets a FontEastAsianLanguage enumerated value that indicates the version of glyphs to be used for a specific writing system or language.
Public propertyEastAsianWidthsGets or sets a FontEastAsianWidths enumerated value that indicates the proportional width to be used for Latin characters in an East Asian font.
Public propertyFractionGets or sets a FontFraction enumerated value that indicates the fraction style.
Public propertyHistoricalFormsGets or sets a value that determines whether historical forms are enabled.
Public propertyHistoricalLigaturesGets or sets a value that indicates whether historical ligatures are enabled.
Public propertyKerningGets or sets a value that indicates whether kerning is enabled.
Public propertyMathematicalGreekGets 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 propertyNumeralAlignmentGets or sets a FontNumeralAlignment enumerated value that indicates the alighnment of widths when using numerals.
Public propertyNumeralStyleGets or sets a FontNumeralStyle enumerated value that determines the set of glyphs that are used to render numeric alternate font forms.
Public propertySlashedZeroGets or sets a value that indicates whether a nominal zero font form should be replaced with a slashed zero.
Public propertyStandardLigaturesGets or sets a value that indicates whether standard ligatures are enabled.
Public propertyStandardSwashesGets or sets a value that specifies the index of a standard swashes form.
Public propertyStylisticAlternatesGets or sets a value that specifies the index of a stylistic alternates form.
Public propertyStylisticSet1Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet10Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet11Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet12Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet13Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet14Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet15Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet16Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet17Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet18Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet19Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet2Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet20Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet3Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet4Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet5Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet6Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet7Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet8Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyStylisticSet9Gets or sets a value that indicates whether a stylistic set of a font form is enabled.
Public propertyVariantsGets or sets a FontVariants enumerated value that indicates a variation of the standard typographic form to be used.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodStatic memberGetAnnotationAlternatesReturns the value of the AnnotationAlternates attached property for a specified dependency object.
Public methodStatic memberGetCapitalsReturns the value of the Capitals attached property for a specified dependency object.
Public methodStatic memberGetCapitalSpacingReturns the value of the CapitalSpacing attached property for a specified dependency object.
Public methodStatic memberGetCaseSensitiveFormsReturns the value of the CaseSensitiveForms attached property for a specified dependency object.
Public methodStatic memberGetContextualAlternatesReturns the value of the ContextualAlternates attached property for a specified dependency object.
Public methodStatic memberGetContextualLigaturesReturns the value of the ContextualLigatures attached property for a specified dependency object.
Public methodStatic memberGetContextualSwashesReturns the value of the ContextualSwashes attached property for a specified dependency object.
Public methodStatic memberGetDiscretionaryLigaturesReturns the value of the DiscretionaryLigatures attached property for a specified dependency object.
Public methodStatic memberGetEastAsianExpertFormsReturns the value of the EastAsianExpertForms attached property for a specified dependency object.
Public methodStatic memberGetEastAsianLanguageReturns the value of the EastAsianLanguage attached property for a specified dependency object.
Public methodStatic memberGetEastAsianWidthsReturns the value of the EastAsianWidths attached property for a specified dependency object.
Public methodStatic memberGetFractionReturns the value of the Fraction attached property for a specified dependency object.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodStatic memberGetHistoricalFormsReturns the value of the HistoricalForms attached property for a specified dependency object.
Public methodStatic memberGetHistoricalLigaturesReturns the value of the HistoricalLigatures attached property for a specified dependency object.
Public methodStatic memberGetKerningReturns the value of the Kerning attached property for a specified dependency object.
Public methodStatic memberGetMathematicalGreekReturns the value of the MathematicalGreek attached property for a specified dependency object.
Public methodStatic memberGetNumeralAlignmentReturns the value of the NumeralAlignment attached property for a specified dependency object.
Public methodStatic memberGetNumeralStyleReturns the value of the NumeralStyle attached property for a specified dependency object.
Public methodStatic memberGetSlashedZeroReturns the value of the SlashedZero attached property for a specified dependency object.
Public methodStatic memberGetStandardLigaturesReturns the value of the StandardLigatures attached property for a specified dependency object.
Public methodStatic memberGetStandardSwashesReturns the value of the StandardSwashes attached property for a specified dependency object.
Public methodStatic memberGetStylisticAlternatesReturns the value of the StylisticAlternates attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet1Returns the value of the StylisticSet1 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet10Returns the value of the StylisticSet10 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet11Returns the value of the StylisticSet11 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet12Returns the value of the StylisticSet12 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet13Returns the value of the StylisticSet13 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet14Returns the value of the StylisticSet14 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet15Returns the value of the StylisticSet15 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet16Returns the value of the StylisticSet16 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet17Returns the value of the StylisticSet17 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet18Returns the value of the StylisticSet18 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet19Returns the value of the StylisticSet19 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet2Returns the value of the StylisticSet2 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet20Returns the value of the StylisticSet20 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet3Returns the value of the StylisticSet3 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet4Returns the value of the StylisticSet4 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet5Returns the value of the StylisticSet5 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet6Returns the value of the StylisticSet6 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet7Returns the value of the StylisticSet7 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet8Returns the value of the StylisticSet8 attached property for a specified dependency object.
Public methodStatic memberGetStylisticSet9Returns the value of the StylisticSet8 attached property for a specified dependency object.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodStatic memberGetVariantsReturns the value of the Variants attached property for a specified dependency object.
Public methodStatic memberSetAnnotationAlternatesSets the value of the AnnotationAlternates attached property for a specified dependency object.
Public methodStatic memberSetCapitalsSets the value of the Capitals attached property for a specified dependency object.
Public methodStatic memberSetCapitalSpacingSets the value of the CapitalSpacing attached property for a specified dependency object.
Public methodStatic memberSetCaseSensitiveFormsSets the value of the CaseSensitiveForms attached property for a specified dependency object.
Public methodStatic memberSetContextualAlternatesSets the value of the ContextualAlternates attached property for a specified dependency object.
Public methodStatic memberSetContextualLigaturesSets the value of the ContextualLigatures attached property for a specified dependency object.
Public methodStatic memberSetContextualSwashesSets the value of the ContextualSwashes attached property for a specified dependency object.
Public methodStatic memberSetDiscretionaryLigaturesSets the value of the DiscretionaryLigatures attached property for a specified dependency object.
Public methodStatic memberSetEastAsianExpertFormsSets the value of the EastAsianExpertForms attached property for a specified dependency object.
Public methodStatic memberSetEastAsianLanguageSets the value of the EastAsianLanguage attached property for a specified dependency object.
Public methodStatic memberSetEastAsianWidthsSets the value of the EastAsianWidths attached property for a specified dependency object.
Public methodStatic memberSetFractionSets the value of the Fraction attached property for a specified dependency object.
Public methodStatic memberSetHistoricalFormsSets the value of the HistoricalForms attached property for a specified dependency object.
Public methodStatic memberSetHistoricalLigaturesSets the value of the HistoricalLigatures attached property for a specified dependency object.
Public methodStatic memberSetKerningSets the value of the Kerning attached property for a specified dependency object.
Public methodStatic memberSetMathematicalGreekSets the value of the MathematicalGreek attached property for a specified dependency object.
Public methodStatic memberSetNumeralAlignmentSets the value of the NumeralAlignment attached property for a specified dependency object.
Public methodStatic memberSetNumeralStyleSets the value of the NumeralStyle attached property for a specified dependency object.
Public methodStatic memberSetSlashedZeroSets the value of the SlashedZero attached property for a specified dependency object.
Public methodStatic memberSetStandardLigaturesSets the value of the StandardLigatures attached property for a specified dependency object.
Public methodStatic memberSetStandardSwashesSets the value of the StandardSwashes attached property for a specified dependency object.
Public methodStatic memberSetStylisticAlternatesSets the value of the StylisticAlternates attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet1Sets the value of the StylisticSet1 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet10Sets the value of the StylisticSet10 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet11Sets the value of the StylisticSet11 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet12Sets the value of the StylisticSet12 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet13Sets the value of the StylisticSet13 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet14Sets the value of the StylisticSet14 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet15Sets the value of the StylisticSet15 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet16Sets the value of the StylisticSet16 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet17Sets the value of the StylisticSet17 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet18Sets the value of the StylisticSet18 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet19Sets the value of the StylisticSet19 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet2Sets the value of the StylisticSet2 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet20Sets the value of the StylisticSet20 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet3Sets the value of the StylisticSet3 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet4Sets the value of the StylisticSet4 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet5Sets the value of the StylisticSet5 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet6Sets the value of the StylisticSet6 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet7Sets the value of the StylisticSet7 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet8Sets the value of the StylisticSet8 attached property for a specified dependency object.
Public methodStatic memberSetStylisticSet9Sets the value of the StylisticSet9 attached property for a specified dependency object.
Public methodStatic memberSetVariantsSets the value of the Variants attached property for a specified dependency object.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top
  NameDescription
Public fieldStatic memberAnnotationAlternatesPropertyIdentifies the AnnotationAlternates attached property.
Public fieldStatic memberCapitalSpacingPropertyIdentifies the CapitalSpacing attached property.
Public fieldStatic memberCapitalsPropertyIdentifies the Capitals attached property.
Public fieldStatic memberCaseSensitiveFormsPropertyIdentifies the CaseSensitiveForms attached property.
Public fieldStatic memberContextualAlternatesPropertyIdentifies the ContextualAlternates attached property.
Public fieldStatic memberContextualLigaturesPropertyIdentifies the ContextualLigatures attached property.
Public fieldStatic memberContextualSwashesPropertyIdentifies the ContextualSwashes attached property.
Public fieldStatic memberDiscretionaryLigaturesPropertyIdentifies the DiscretionaryLigatures attached property.
Public fieldStatic memberEastAsianExpertFormsPropertyIdentifies the EastAsianExpertForms attached property.
Public fieldStatic memberEastAsianLanguagePropertyIdentifies the EastAsianLanguage attached property.
Public fieldStatic memberEastAsianWidthsPropertyIdentifies the EastAsianWidths attached property.
Public fieldStatic memberFractionPropertyIdentifies the Fraction attached property.
Public fieldStatic memberHistoricalFormsPropertyIdentifies the HistoricalForms attached property.
Public fieldStatic memberHistoricalLigaturesPropertyIdentifies the HistoricalLigatures attached property.
Public fieldStatic memberKerningPropertyIdentifies the Kerning attached property.
Public fieldStatic memberMathematicalGreekPropertyIdentifies the MathematicalGreek attached property.
Public fieldStatic memberNumeralAlignmentPropertyIdentifies the NumeralAlignment attached property.
Public fieldStatic memberNumeralStylePropertyIdentifies the NumeralStyle attached property.
Public fieldStatic memberSlashedZeroPropertyIdentifies the SlashedZero attached property.
Public fieldStatic memberStandardLigaturesPropertyIdentifies the StandardLigatures attached property.
Public fieldStatic memberStandardSwashesPropertyIdentifies the StandardSwashes attached property.
Public fieldStatic memberStylisticAlternatesPropertyIdentifies the StylisticAlternates attached property.
Public fieldStatic memberStylisticSet10PropertyIdentifies the StylisticSet10 attached property.
Public fieldStatic memberStylisticSet11PropertyIdentifies the StylisticSet11 attached property.
Public fieldStatic memberStylisticSet12PropertyIdentifies the StylisticSet12 attached property.
Public fieldStatic memberStylisticSet13PropertyIdentifies the StylisticSet13 attached property.
Public fieldStatic memberStylisticSet14PropertyIdentifies the StylisticSet14 attached property.
Public fieldStatic memberStylisticSet15PropertyIdentifies the StylisticSet15 attached property.
Public fieldStatic memberStylisticSet16PropertyIdentifies the StylisticSet16 attached property.
Public fieldStatic memberStylisticSet17PropertyIdentifies the StylisticSet17 attached property.
Public fieldStatic memberStylisticSet18PropertyIdentifies the StylisticSet18 attached property.
Public fieldStatic memberStylisticSet19PropertyIdentifies the StylisticSet19 attached property.
Public fieldStatic memberStylisticSet1PropertyIdentifies the StylisticSet1 attached property.
Public fieldStatic memberStylisticSet20PropertyIdentifies the StylisticSet20 attached property.
Public fieldStatic memberStylisticSet2PropertyIdentifies the StylisticSet2 attached property.
Public fieldStatic memberStylisticSet3PropertyIdentifies the StylisticSet3 attached property.
Public fieldStatic memberStylisticSet4PropertyIdentifies the StylisticSet4 attached property.
Public fieldStatic memberStylisticSet5PropertyIdentifies the StylisticSet5 attached property.
Public fieldStatic memberStylisticSet6PropertyIdentifies the StylisticSet6 attached property.
Public fieldStatic memberStylisticSet7PropertyIdentifies the StylisticSet7 attached property.
Public fieldStatic memberStylisticSet8PropertyIdentifies the StylisticSet8 attached property.
Public fieldStatic memberStylisticSet9PropertyIdentifies the StylisticSet9 attached property.
Public fieldStatic memberVariantsPropertyIdentifies the Variants attached property.
Top

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;

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".../>

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>

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft. All rights reserved.