Skip to main content

FontCollectionKey Struct

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Represents a unique key for identifying a font inside a font collection based on style, weight, and stretch attributes.

public struct FontCollectionKey

Inheritance: ValueType -> FontCollectionKey

Implements: IComparable, IComparable<FontCollectionKey>, IEquatable<FontCollectionKey>

Remarks​

Use this key to efficiently look up or group fonts in a collection by their style, weight, and stretch characteristics. Keys are ordered lexicographically by Avalonia.Media.Fonts.FontCollectionKey.Style, then Avalonia.Media.Fonts.FontCollectionKey.Weight, then Avalonia.Media.Fonts.FontCollectionKey.Stretch.

Constructors​

NameDescription
FontCollectionKeyRepresents a unique key for identifying a font inside a font collection based on style, weight, and stretch attributes.

FontCollectionKey Constructor​

Represents a unique key for identifying a font inside a font collection based on style, weight, and stretch attributes.

public FontCollectionKey(Avalonia.Media.FontStyle Style, Avalonia.Media.FontWeight Weight, Avalonia.Media.FontStretch Stretch)

Parameters​

Style Avalonia.Media.FontStyle

The font style to use when constructing the key.

Weight Avalonia.Media.FontWeight

The font weight to use when constructing the key.

Stretch Avalonia.Media.FontStretch

The font stretch to use when constructing the key.

Remarks​

Use this key to efficiently look up or group fonts in a collection by their style, weight, and stretch characteristics. Keys are ordered lexicographically by Avalonia.Media.Fonts.FontCollectionKey.Style, then Avalonia.Media.Fonts.FontCollectionKey.Weight, then Avalonia.Media.Fonts.FontCollectionKey.Stretch.

Methods​

NameDescription
CompareTo (2 overloads)No summary available.
DeconstructNo summary available.
Equals (2 overloads)No summary available.
GetHashCodeNo summary available.
ToStringNo summary available.

CompareTo overloads​

CompareTo Method​

public int CompareTo(Avalonia.Media.Fonts.FontCollectionKey other)
Parameters​

other Avalonia.Media.Fonts.FontCollectionKey

Returns​

int

CompareTo Method​

public int CompareTo(object obj)
Parameters​

obj object

Returns​

int

Deconstruct Method​

public void Deconstruct(Avalonia.Media.FontStyle& Style, Avalonia.Media.FontWeight& Weight, Avalonia.Media.FontStretch& Stretch)

Parameters​

Style Avalonia.Media.FontStyle&

Weight Avalonia.Media.FontWeight&

Stretch Avalonia.Media.FontStretch&

Equals overloads​

Equals Method​

public bool Equals(Avalonia.Media.Fonts.FontCollectionKey other)
Parameters​

other Avalonia.Media.Fonts.FontCollectionKey

Returns​

bool

Equals Method​

public bool Equals(object obj)
Parameters​

obj object

Returns​

bool

GetHashCode Method​

public int GetHashCode()

Returns​

int

ToString Method​

public string ToString()

Returns​

string

Properties​

NameDescription
StretchThe font stretch to use when constructing the key.
StyleThe font style to use when constructing the key.
WeightThe font weight to use when constructing the key.

Stretch Property​

The font stretch to use when constructing the key.

public Avalonia.Media.FontStretch Stretch { get; set; }

Style Property​

The font style to use when constructing the key.

public Avalonia.Media.FontStyle Style { get; set; }

Weight Property​

The font weight to use when constructing the key.

public Avalonia.Media.FontWeight Weight { get; set; }