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

Typography.Variants Property

Gets or sets a FontVariants enumerated value that indicates a variation of the standard typographic form to be used.

Namespace:  System.Windows.Documents
Assembly:  PresentationFramework (in PresentationFramework.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
public FontVariants Variants { get; set; }
<object Typography.Variants="FontVariants"/>

Property Value

Type: System.Windows.FontVariants
A FontVariants enumerated value. The default value is Normal.

This property gets or sets a value on the object that owns a Typography property, which is the only way to access a Typography class instance. In addition, this property supports an attached property usage so that it can be set on text-containing objects in XAML.

Variants are similar to superscript or subscript font forms. It is possible for a font form to contain differing glyph sets between superscript and the ordinal form, or between subscript and inferior forms. The Variants property allows you to set superscript and subscript values for an OpenType font.

The following text displays superscripts for the Palatino Linotype font.

Example of superscripts

Text using OpenType superscripts

The following code example shows how to define superscripts for the Palatino Linotype font, using the Variants property.


<Paragraph FontFamily="Palatino Linotype">
  2<Run Typography.Variants="Superscript">3</Run>
  14<Run Typography.Variants="Superscript">th</Run>
</Paragraph>


The following text displays subscripts for the Palatino Linotype font.

Example of subscripts

Text using OpenType subscripts

The following code example shows how to define subscripts for the Palatino Linotype font, using the Variants property.


<Paragraph FontFamily="Palatino Linotype">
  H<Run Typography.Variants="Subscript">2</Run>O
  Footnote<Run Typography.Variants="Subscript">4</Run>
</Paragraph>


Fonts that do not support variants may have an algorithmic approximation of the font form.

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.