Typography Class
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace: http://schemas.microsoft.com/winfx/2006/xaml/presentation
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());
Typography Properties
The following table lists the properties, values, and default value of the Typography object.
| Property | Value(s) | Default Value |
|---|---|---|
| Numeric value - byte | 0 | |
| AllPetiteCaps | AllSmallCaps | Normal | PetiteCaps | SmallCaps | Titling | Unicase | FontCapitals.Normal | |
| false | ||
| Boolean | false | |
| Boolean | true | |
| Boolean | true | |
| Numeric value - byte | 0 | |
| Boolean | false | |
| Boolean | false | |
| HojoKanji | Jis04 | Jis78 | Jis83 | Jis90 | NlcKanji | Normal | Simplified | Traditional | TraditionalNames | FontEastAsianLanguage.Normal | |
| FontEastAsianWidths.Normal | ||
| FontFraction.Normal | ||
| Boolean | false | |
| Boolean | false | |
| Boolean | true | |
| Boolean | false | |
| FontNumeralAlignment.Normal | ||
| Boolean | ||
| Boolean | false | |
| Boolean | true | |
| numeric value – byte | 0 | |
| numeric value – byte | 0 | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Boolean | false | |
| Inferior | Normal | Ordinal | Ruby | Subscript | Superscript | FontVariants.Normal |
Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.