-api-id | -api-type |
---|---|
T:Windows.UI.Text.FontWeights |
winrt class |
Provides a set of predefined font weights as static property values.
See XAML Syntax for FontWeight
In standard typography API, the weight of a font is expressed by using constant names, for example "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 factor of a FontWeight value.
This image shows the various font weight values applied to text.
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;