FontStretch Property

TextBlock.FontStretch Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets the font stretch for the text content in this element.

Namespace:  System.Windows.Controls
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

public FontStretch FontStretch { get; set; }
<TextBlock FontStretch="fontStretchesValue"/>

XAML Values


A FontStretches property name, such as Condensed, Normal, or Expanded. See Remarks regarding font fallback issues.

Property Value

Type: System.Windows.FontStretch
The requested font stretch, which is a FontStretch that is obtained from one of the FontStretches property values. The default is Normal.

Dependency property identifier field: FontStretchProperty

A font stretch describes the degree to which a font form is stretched from its normal aspect ratio. (The aspect ratio is the original width to height ratio specified for the glyphs in the font.) This property can select only from fonts that exist in a font family and the corresponding glyphs. Setting a FontStretch value that does not inherently exist in a font family does not cause programmatic stretching of glyphs. Font fallback behavior does not change the property value, the property will remain as the value you set it to despite whatever visual behavior results due to font fallback.

The FontStretches properties correspond to the usWidthClass definition in the OpenType specification. The usWidthClass represents an integer value between 1 and 9. Lower numeric values indicate narrower widths, and higher values indicate wider widths. For more information about usWidthClass, see the enumeration table in FontStretches.

FontStretch settings for Run child elements override the settings on the containing TextBlock.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft