FontWeights Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a set of predefined font weights as static property values.
public ref class FontWeights sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class FontWeights final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class FontWeights
Public NotInheritable Class FontWeights
See XAML Syntax for FontWeight
- Inheritance
- Attributes
Device family |
Windows 10 (introduced in 10.0.10240.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v1.0)
|
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, 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.

Black |
Specifies a font weight value of 900. |
Bold |
Specifies a font weight value of 700. |
Extra |
Specifies a font weight value of 950. |
Extra |
Specifies a font weight value of 800. |
Extra |
Specifies a font weight value of 200. |
Light |
Specifies a font weight value of 300. |
Medium |
Specifies a font weight value of 500. |
Normal |
Specifies a font weight value of 400. |
Semi |
Specifies a font weight value of 600. |
Semi |
Specifies a font weight value of 350. |
Thin |
Specifies a font weight value of 100. |
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |