FontVariationSetting Struct
The value of an axis of a variable font: a weight of 650 (wght), a width of 80 (wdth).
public readonly struct FontVariationSetting : IEquatable<FontVariationSetting>Remarks
The tags and the ranges of the axes of a font are in Font.VariationAxes.
- Implements
Constructors
| Name | Description |
|---|---|
| FontVariationSetting(string, double) | Initializes a new instance of the FontVariationSetting struct. |
FontVariationSetting(string, double)
FontVariationSetting.csInitializes a new instance of the FontVariationSetting struct.
Parameters
tagstring- The tag of the axis: four printable ASCII characters, such as
wght. valuedouble- The value, in the units of the axis.
Exceptions
ArgumentNullExceptiontagisnull.ArgumentExceptiontagis not four printable ASCII characters, orvalueis not a finite number.
Properties
| Name | Description |
|---|---|
| Tag | Gets the tag of the axis. |
| Value | Gets the value, in the units of the axis. |
Methods
| Name | Description |
|---|---|
| Equals(FontVariationSetting) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
| ToString() | Returns the setting in the syntax of CSS: "wght" 650. |
Equals overloads
Equals(FontVariationSetting)
FontVariationSetting.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(FontVariationSetting other)Parameters
otherFontVariationSetting- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
FontVariationSetting.csGetHashCode()
FontVariationSetting.csToString()
FontVariationSetting.csOperators
| Name | Description |
|---|---|
| operator ==(FontVariationSetting, FontVariationSetting) | Tells whether two settings are the same axis and the same value. |
| operator !=(FontVariationSetting, FontVariationSetting) | Tells whether two settings differ. |
operator ==(FontVariationSetting, FontVariationSetting)
FontVariationSetting.csTells whether two settings are the same axis and the same value.
public static bool operator ==(FontVariationSetting left, FontVariationSetting right)operator !=(FontVariationSetting, FontVariationSetting)
FontVariationSetting.csTells whether two settings differ.
public static bool operator !=(FontVariationSetting left, FontVariationSetting right)