FontWeight

FontWeight structure

Font-weight property sets the weight (or boldness) of the font. The weights available depend on the font-family that is currently set.

public struct FontWeight : IEquatable<FontWeight>

Properties

Name Description
IsAbsolute { get; } Indicates whether this font-weight instance stores an absolute value of the weight (boldness) of the font, as an integer number
IsInitial { get; } Indicates whether this font-size has an initial value (Medium)
IsRelative { get; } Indicates whether this font-weight instance stores a relative value of the weight (boldness) of the font - compared to the boldness of the parent element
Number { get; } Returns a number - integer value between 1 and 1000, inclusive, which describes the boldness of the font, or throws an exception, if current boldness is not absolute, but relative
Value { get; } Returns a value of this font-weight as a string

Methods

Name Description
static FromNumber(ushort) Creates a font-weight from specified number
Equals(FontWeight) Determines whether specified FontWeight instances are equal
override Equals(object) Determines whether this FontWeight instance is equal to specified uncasted
override GetHashCode() Returns a hash-code for this instance
static TryParse(string, out FontWeight) Tries to parse a specified string and return a valid FontWeight instance on success
operator == Checks whether two “FontWeight” values are equal
operator != Checks whether two “FontWeight” values are not equal

Fields

Name Description
static readonly Bold Bold font weight. Same as 700.
static readonly Bolder One relative font weight heavier than the parent element
static readonly Lighter One relative font weight lighter than the parent element
static readonly Normal Normal font weight. Same as 400.

See Also