Struct
FontWeight

Represents the numeric thickness of a font face (e.g., 100–900) used to choose weight during text layout.

Definition

Namespace:Telerik.Documents.Core.Fonts

Assembly:Telerik.Windows.Documents.Core.dll

Syntax:

cs-api-definition
public struct FontWeight

Constructors

FontWeight(int)

Create a new weight from its numeric value.

Declaration

cs-api-definition
public FontWeight(int weight)

Parameters

weight

int

Methods

Equals(object)

Determines whether the specified object is equal to the current FontWeight.

Declaration

cs-api-definition
public override bool Equals(object obj)

Parameters

obj

object

The object to compare with the current instance.

Returns

bool

True if the specified object is a FontWeight with the same numeric value; otherwise, false.

Overrides ValueType.Equals(object)

GetHashCode()

Returns a hash code for the current FontWeight.

Declaration

cs-api-definition
public override int GetHashCode()

Returns

int

A hash code derived from the underlying numeric weight, suitable for use in hashing algorithms and data structures.

Overrides ValueType.GetHashCode()

ToString()

Returns a string that represents the current FontWeight. When possible, a human-readable name is returned (for example, "Bold"); otherwise the numeric value.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string representation of this font weight.

Overrides ValueType.ToString()

Operators

operator !=(FontWeight, FontWeight)

Determine whether two weights differ.

Declaration

cs-api-definition
public static bool operator !=(FontWeight fw1, FontWeight fw2)

Parameters

fw1

FontWeight

First object to compare.

fw2

FontWeight

Second object to compare.

Returns

bool

Returns false when the font weight values are equal for both objects, and true otherwise.

operator <(FontWeight, FontWeight)

Test whether the left weight is lighter than the right.

Declaration

cs-api-definition
public static bool operator <(FontWeight fw1, FontWeight fw2)

Parameters

fw1

FontWeight

First object to compare.

fw2

FontWeight

Second object to compare.

Returns

bool

operator <=(FontWeight, FontWeight)

Test whether the left weight is lighter than or equal to the right.

Declaration

cs-api-definition
public static bool operator <=(FontWeight fw1, FontWeight fw2)

Parameters

fw1

FontWeight

First object to compare.

fw2

FontWeight

Second object to compare.

Returns

bool

operator ==(FontWeight, FontWeight)

Compare two weights for value equality.

Declaration

cs-api-definition
public static bool operator ==(FontWeight fw1, FontWeight fw2)

Parameters

fw1

FontWeight

First object to compare.

fw2

FontWeight

Second object to compare.

Returns

bool

Returns true when the font weight values are equal for both objects, and false otherwise.

operator >(FontWeight, FontWeight)

Test whether the left weight is heavier than the right.

Declaration

cs-api-definition
public static bool operator >(FontWeight fw1, FontWeight fw2)

Parameters

fw1

FontWeight

First object to compare.

fw2

FontWeight

Second object to compare.

Returns

bool

operator >=(FontWeight, FontWeight)

Test whether the left weight is heavier than or equal to the right.

Declaration

cs-api-definition
public static bool operator >=(FontWeight fw1, FontWeight fw2)

Parameters

fw1

FontWeight

First object to compare.

fw2

FontWeight

Second object to compare.

Returns

bool