FontFeature Struct
A feature of the OpenType Layout tables of a font, turned on or off for a text: ligatures (liga), kerning (kern), small capitals (smcp), tabular figures (tnum), a stylistic set (ss01)...
public readonly struct FontFeature : IEquatable<FontFeature>Remarks
A feature is named by its registered tag of four characters. A value of 0 turns it off and 1 turns it on; a larger value selects one of several alternates when the feature offers a choice (salt, cv01). A feature the font does not have changes nothing.
- Implements
Constructors
| Name | Description |
|---|---|
| FontFeature(string, int) | Initializes a feature setting. |
FontFeature(string, int)
FontFeature.csInitializes a feature setting.
Parameters
tagstring- The tag of the feature: four printable ASCII characters.
valueint- 0 to turn the feature off, 1 to turn it on, or the number of an alternate.
Exceptions
ArgumentNullExceptiontagisnull.ArgumentExceptiontagis not four printable ASCII characters.ArgumentOutOfRangeExceptionvalueis negative or greater than 65535.
Properties
| Name | Description |
|---|---|
| Tag | Gets the tag of the feature. |
| Value | Gets the value of the feature: 0 is off, 1 is on, a larger value is the number of an alternate. |
Value
FontFeature.csMethods
| Name | Description |
|---|---|
| Equals(FontFeature) | 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 feature in the form liga=0. |
Equals overloads
Equals(FontFeature)
FontFeature.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(FontFeature other)Parameters
otherFontFeature- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
FontFeature.csGetHashCode()
FontFeature.csToString()
FontFeature.csOperators
| Name | Description |
|---|---|
| operator ==(FontFeature, FontFeature) | Determines whether two feature settings are the same. |
| operator !=(FontFeature, FontFeature) | Determines whether two feature settings differ. |
operator ==(FontFeature, FontFeature)
FontFeature.csDetermines whether two feature settings are the same.
public static bool operator ==(FontFeature left, FontFeature right)operator !=(FontFeature, FontFeature)
FontFeature.csDetermines whether two feature settings differ.
public static bool operator !=(FontFeature left, FontFeature right)