Typography Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides access to a rich set of OpenType typography properties.
public ref class Typography sealed
public sealed class Typography
type Typography = class
Public NotInheritable Class Typography
- Inheritance
-
Typography
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>
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
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());
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())
Typography Properties
The following table lists the properties, values, and default value of the Typography object.
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
" .../>
Fields
Properties
AnnotationAlternates |
Gets or sets a value that specifies the index of an alternate annotation form. |
Capitals |
Gets or sets a FontCapitals enumerated value that indicates the capital form of the selected font. |
CapitalSpacing |
Gets or sets a value that determines whether inter-glyph spacing for all-capital text is globally adjusted to improve readability. |
CaseSensitiveForms |
Gets or sets a value that determines whether glyphs adjust their vertical position to better align with uppercase glyphs. |
ContextualAlternates |
Gets or sets a value that determines whether custom glyph forms can be used based upon the context of the text being rendered. |
ContextualLigatures |
Gets or sets a value that determines whether contextual ligatures are enabled. |
ContextualSwashes |
Gets or sets a value that specifies the index of a contextual swashes form. |
DiscretionaryLigatures |
Gets or sets a value that determines whether discretionary ligatures are enabled. |
EastAsianExpertForms |
Gets or sets a value that determines whether the standard Japanese font forms have been replaced with the corresponding preferred typographic forms. |
EastAsianLanguage |
Gets or sets a FontEastAsianLanguage enumerated value that indicates the version of glyphs to be used for a specific writing system or language. |
EastAsianWidths |
Gets or sets a FontEastAsianWidths enumerated value that indicates the proportional width to be used for Latin characters in an East Asian font. |
Fraction |
Gets or sets a FontFraction enumerated value that indicates the fraction style. |
HistoricalForms |
Gets or sets a value that determines whether historical forms are enabled. |
HistoricalLigatures |
Gets or sets a value that indicates whether historical ligatures are enabled. |
Kerning |
Gets or sets a value that indicates whether kerning is enabled. |
MathematicalGreek |
Gets 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. |
NumeralAlignment |
Gets or sets a FontNumeralAlignment enumerated value that indicates the alignment of widths when using numerals. |
NumeralStyle |
Gets or sets a FontNumeralStyle enumerated value that determines the set of glyphs that are used to render numeric alternate font forms. |
SlashedZero |
Gets or sets a value that indicates whether a nominal zero font form should be replaced with a slashed zero. |
StandardLigatures |
Gets or sets a value that indicates whether standard ligatures are enabled. |
StandardSwashes |
Gets or sets a value that specifies the index of a standard swashes form. |
StylisticAlternates |
Gets or sets a value that specifies the index of a stylistic alternates form. |
StylisticSet1 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet10 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet11 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet12 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet13 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet14 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet15 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet16 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet17 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet18 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet19 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet2 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet20 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet3 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet4 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet5 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet6 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet7 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet8 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
StylisticSet9 |
Gets or sets a value that indicates whether a stylistic set of a font form is enabled. |
Variants |
Gets or sets a FontVariants enumerated value that indicates a variation of the standard typographic form to be used. |
Methods
Equals(Object) |
Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetAnnotationAlternates(DependencyObject) |
Returns the value of the AnnotationAlternates attached property for a specified dependency object. |
GetCapitals(DependencyObject) |
Returns the value of the Capitals attached property for a specified dependency object. |
GetCapitalSpacing(DependencyObject) |
Returns the value of the CapitalSpacing attached property for a specified dependency object. |
GetCaseSensitiveForms(DependencyObject) |
Returns the value of the CaseSensitiveForms attached property for a specified dependency object. |
GetContextualAlternates(DependencyObject) |
Returns the value of the ContextualAlternates attached property for a specified dependency object. |
GetContextualLigatures(DependencyObject) |
Returns the value of the ContextualLigatures attached property for a specified dependency object. |
GetContextualSwashes(DependencyObject) |
Returns the value of the ContextualSwashes attached property for a specified dependency object. |
GetDiscretionaryLigatures(DependencyObject) |
Returns the value of the DiscretionaryLigatures attached property for a specified dependency object. |
GetEastAsianExpertForms(DependencyObject) |
Returns the value of the EastAsianExpertForms attached property for a specified dependency object. |
GetEastAsianLanguage(DependencyObject) |
Returns the value of the EastAsianLanguage attached property for a specified dependency object. |
GetEastAsianWidths(DependencyObject) |
Returns the value of the EastAsianWidths attached property for a specified dependency object. |
GetFraction(DependencyObject) |
Returns the value of the Fraction attached property for a specified dependency object. |
GetHashCode() |
Serves as the default hash function. (Inherited from Object) |
GetHistoricalForms(DependencyObject) |
Returns the value of the HistoricalForms attached property for a specified dependency object. |
GetHistoricalLigatures(DependencyObject) |
Returns the value of the HistoricalLigatures attached property for a specified dependency object. |
GetKerning(DependencyObject) |
Returns the value of the Kerning attached property for a specified dependency object. |
GetMathematicalGreek(DependencyObject) |
Returns the value of the MathematicalGreek attached property for a specified dependency object. |
GetNumeralAlignment(DependencyObject) |
Returns the value of the NumeralAlignment attached property for a specified dependency object. |
GetNumeralStyle(DependencyObject) |
Returns the value of the NumeralStyle attached property for a specified dependency object. |
GetSlashedZero(DependencyObject) |
Returns the value of the SlashedZero attached property for a specified dependency object. |
GetStandardLigatures(DependencyObject) |
Returns the value of the StandardLigatures attached property for a specified dependency object. |
GetStandardSwashes(DependencyObject) |
Returns the value of the StandardSwashes attached property for a specified dependency object. |
GetStylisticAlternates(DependencyObject) |
Returns the value of the StylisticAlternates attached property for a specified dependency object. |
GetStylisticSet1(DependencyObject) |
Returns the value of the StylisticSet1 attached property for a specified dependency object. |
GetStylisticSet10(DependencyObject) |
Returns the value of the StylisticSet10 attached property for a specified dependency object. |
GetStylisticSet11(DependencyObject) |
Returns the value of the StylisticSet11 attached property for a specified dependency object. |
GetStylisticSet12(DependencyObject) |
Returns the value of the StylisticSet12 attached property for a specified dependency object. |
GetStylisticSet13(DependencyObject) |
Returns the value of the StylisticSet13 attached property for a specified dependency object. |
GetStylisticSet14(DependencyObject) |
Returns the value of the StylisticSet14 attached property for a specified dependency object. |
GetStylisticSet15(DependencyObject) |
Returns the value of the StylisticSet15 attached property for a specified dependency object. |
GetStylisticSet16(DependencyObject) |
Returns the value of the StylisticSet16 attached property for a specified dependency object. |
GetStylisticSet17(DependencyObject) |
Returns the value of the StylisticSet17 attached property for a specified dependency object. |
GetStylisticSet18(DependencyObject) |
Returns the value of the StylisticSet18 attached property for a specified dependency object. |
GetStylisticSet19(DependencyObject) |
Returns the value of the StylisticSet19 attached property for a specified dependency object. |
GetStylisticSet2(DependencyObject) |
Returns the value of the StylisticSet2 attached property for a specified dependency object. |
GetStylisticSet20(DependencyObject) |
Returns the value of the StylisticSet20 attached property for a specified dependency object. |
GetStylisticSet3(DependencyObject) |
Returns the value of the StylisticSet3 attached property for a specified dependency object. |
GetStylisticSet4(DependencyObject) |
Returns the value of the StylisticSet4 attached property for a specified dependency object. |
GetStylisticSet5(DependencyObject) |
Returns the value of the StylisticSet5 attached property for a specified dependency object. |
GetStylisticSet6(DependencyObject) |
Returns the value of the StylisticSet6 attached property for a specified dependency object. |
GetStylisticSet7(DependencyObject) |
Returns the value of the StylisticSet7 attached property for a specified dependency object. |
GetStylisticSet8(DependencyObject) |
Returns the value of the StylisticSet8 attached property for a specified dependency object. |
GetStylisticSet9(DependencyObject) |
Returns the value of the StylisticSet8 attached property for a specified dependency object. |
GetType() |
Gets the Type of the current instance. (Inherited from Object) |
GetVariants(DependencyObject) |
Returns the value of the Variants attached property for a specified dependency object. |
MemberwiseClone() |
Creates a shallow copy of the current Object. (Inherited from Object) |
SetAnnotationAlternates(DependencyObject, Int32) |
Sets the value of the AnnotationAlternates attached property for a specified dependency object. |
SetCapitals(DependencyObject, FontCapitals) |
Sets the value of the Capitals attached property for a specified dependency object. |
SetCapitalSpacing(DependencyObject, Boolean) |
Sets the value of the CapitalSpacing attached property for a specified dependency object. |
SetCaseSensitiveForms(DependencyObject, Boolean) |
Sets the value of the CaseSensitiveForms attached property for a specified dependency object. |
SetContextualAlternates(DependencyObject, Boolean) |
Sets the value of the ContextualAlternates attached property for a specified dependency object. |
SetContextualLigatures(DependencyObject, Boolean) |
Sets the value of the ContextualLigatures attached property for a specified dependency object. |
SetContextualSwashes(DependencyObject, Int32) |
Sets the value of the ContextualSwashes attached property for a specified dependency object. |
SetDiscretionaryLigatures(DependencyObject, Boolean) |
Sets the value of the DiscretionaryLigatures attached property for a specified dependency object. |
SetEastAsianExpertForms(DependencyObject, Boolean) |
Sets the value of the EastAsianExpertForms attached property for a specified dependency object. |
SetEastAsianLanguage(DependencyObject, FontEastAsianLanguage) |
Sets the value of the EastAsianLanguage attached property for a specified dependency object. |
SetEastAsianWidths(DependencyObject, FontEastAsianWidths) |
Sets the value of the EastAsianWidths attached property for a specified dependency object. |
SetFraction(DependencyObject, FontFraction) |
Sets the value of the Fraction attached property for a specified dependency object. |
SetHistoricalForms(DependencyObject, Boolean) |
Sets the value of the HistoricalForms attached property for a specified dependency object. |
SetHistoricalLigatures(DependencyObject, Boolean) |
Sets the value of the HistoricalLigatures attached property for a specified dependency object. |
SetKerning(DependencyObject, Boolean) |
Sets the value of the Kerning attached property for a specified dependency object. |
SetMathematicalGreek(DependencyObject, Boolean) |
Sets the value of the MathematicalGreek attached property for a specified dependency object. |
SetNumeralAlignment(DependencyObject, FontNumeralAlignment) |
Sets the value of the NumeralAlignment attached property for a specified dependency object. |
SetNumeralStyle(DependencyObject, FontNumeralStyle) |
Sets the value of the NumeralStyle attached property for a specified dependency object. |
SetSlashedZero(DependencyObject, Boolean) |
Sets the value of the SlashedZero attached property for a specified dependency object. |
SetStandardLigatures(DependencyObject, Boolean) |
Sets the value of the StandardLigatures attached property for a specified dependency object. |
SetStandardSwashes(DependencyObject, Int32) |
Sets the value of the StandardSwashes attached property for a specified dependency object. |
SetStylisticAlternates(DependencyObject, Int32) |
Sets the value of the StylisticAlternates attached property for a specified dependency object. |
SetStylisticSet1(DependencyObject, Boolean) |
Sets the value of the StylisticSet1 attached property for a specified dependency object. |
SetStylisticSet10(DependencyObject, Boolean) |
Sets the value of the StylisticSet10 attached property for a specified dependency object. |
SetStylisticSet11(DependencyObject, Boolean) |
Sets the value of the StylisticSet11 attached property for a specified dependency object. |
SetStylisticSet12(DependencyObject, Boolean) |
Sets the value of the StylisticSet12 attached property for a specified dependency object. |
SetStylisticSet13(DependencyObject, Boolean) |
Sets the value of the StylisticSet13 attached property for a specified dependency object. |
SetStylisticSet14(DependencyObject, Boolean) |
Sets the value of the StylisticSet14 attached property for a specified dependency object. |
SetStylisticSet15(DependencyObject, Boolean) |
Sets the value of the StylisticSet15 attached property for a specified dependency object. |
SetStylisticSet16(DependencyObject, Boolean) |
Sets the value of the StylisticSet16 attached property for a specified dependency object. |
SetStylisticSet17(DependencyObject, Boolean) |
Sets the value of the StylisticSet17 attached property for a specified dependency object. |
SetStylisticSet18(DependencyObject, Boolean) |
Sets the value of the StylisticSet18 attached property for a specified dependency object. |
SetStylisticSet19(DependencyObject, Boolean) |
Sets the value of the StylisticSet19 attached property for a specified dependency object. |
SetStylisticSet2(DependencyObject, Boolean) |
Sets the value of the StylisticSet2 attached property for a specified dependency object. |
SetStylisticSet20(DependencyObject, Boolean) |
Sets the value of the StylisticSet20 attached property for a specified dependency object. |
SetStylisticSet3(DependencyObject, Boolean) |
Sets the value of the StylisticSet3 attached property for a specified dependency object. |
SetStylisticSet4(DependencyObject, Boolean) |
Sets the value of the StylisticSet4 attached property for a specified dependency object. |
SetStylisticSet5(DependencyObject, Boolean) |
Sets the value of the StylisticSet5 attached property for a specified dependency object. |
SetStylisticSet6(DependencyObject, Boolean) |
Sets the value of the StylisticSet6 attached property for a specified dependency object. |
SetStylisticSet7(DependencyObject, Boolean) |
Sets the value of the StylisticSet7 attached property for a specified dependency object. |
SetStylisticSet8(DependencyObject, Boolean) |
Sets the value of the StylisticSet8 attached property for a specified dependency object. |
SetStylisticSet9(DependencyObject, Boolean) |
Sets the value of the StylisticSet9 attached property for a specified dependency object. |
SetVariants(DependencyObject, FontVariants) |
Sets the value of the Variants attached property for a specified dependency object. |
ToString() |
Returns a string that represents the current object. (Inherited from Object) |