FontCollectionKey Struct
Definition
Represents a unique key for identifying a font inside a font collection based on style, weight, stretch, and (for variable fonts) the active variation settings.
public struct FontCollectionKey
Remarks
Use this key to efficiently look up or group fonts in a collection by their style, weight, stretch, and variation characteristics. Keys are ordered lexicographically by Avalonia.Media.Fonts.FontCollectionKey.Style, then Avalonia.Media.Fonts.FontCollectionKey.Weight, then Avalonia.Media.Fonts.FontCollectionKey.Stretch, then by the Avalonia.Media.Fonts.FontCollectionKey.Variation coordinates.
For static fonts and variable fonts at the default instance, Variation
is default(NormalizedVariationPosition), so an unspecified Variation
is the zero-cost common case. Internal callers constructing keys for varied
typefaces set Variation via initializer:
new FontCollectionKey(s, w, st) { Variation = position }.
Constructors
| Name | Description |
|---|---|
| FontCollectionKey | Represents a unique key for identifying a font inside a font collection based on style, weight, stretch, and (for variable fonts) the active variation settings. |
FontCollectionKey Constructor
Represents a unique key for identifying a font inside a font collection based on style, weight, stretch, and (for variable fonts) the active variation settings.
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, stretch, and variation characteristics. Keys are ordered lexicographically by Avalonia.Media.Fonts.FontCollectionKey.Style, then Avalonia.Media.Fonts.FontCollectionKey.Weight, then Avalonia.Media.Fonts.FontCollectionKey.Stretch, then by the Avalonia.Media.Fonts.FontCollectionKey.Variation coordinates.
For static fonts and variable fonts at the default instance, Variation
is default(NormalizedVariationPosition), so an unspecified Variation
is the zero-cost common case. Internal callers constructing keys for varied
typefaces set Variation via initializer:
new FontCollectionKey(s, w, st) { Variation = position }.
Methods
| Name | Description |
|---|---|
| CompareTo (2 overloads) | No summary available. |
| Deconstruct | No summary available. |
| Equals (2 overloads) | No summary available. |
| GetHashCode | No summary available. |
| ToString | No 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
| Name | Description |
|---|---|
| Stretch | The font stretch to use when constructing the key. |
| Style | The font style to use when constructing the key. |
| Weight | The 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; }