This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
public value class FontWeight
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
struct FontWeight
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public struct FontWeight
var fontWeight = {
weight : /* Your value */
Public Structure FontWeight
<object property="fontWeightsPropertyName"/>
Inheritance
FontWeight
Examples
This example shows how to set the FontWeight property on a XAML TextBlock.
<TextBlock Text="FontWeight ExtraBlack" FontWeight="ExtraBlack"/>
TextBlock textBlock1 = new TextBlock();
textBlock1.Text = "FontWeight ExtraBlack";
textBlock1.FontWeight = Windows.UI.Text.FontWeights.ExtraBlack;
In standard typography API, the weight of a font is expressed by using constant names such as "Bold". Using constant names for setting a font weight property is supported through type converter behaviors and also by the FontWeights support class. For code access, the relevant information is expressed as the Weight member of a FontWeight structure.
The FontWeights values correspond to the "usWeightClass" definition in the OpenType specification. The "usWeightClass" represents an integer value between 1 and 999. Lower values indicate lighter weights; higher values indicate heavier weights.
The Weight member of a FontWeight structure is typically initiated with one of the FontWeights values. If you access a FontWeight structure in code, you can compare the value of its Weight member with values from the FontWeights static properties.