public sealed class FontVariationWhere along its axes a variable font is being read.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Normalised coordinates, in axis order, and immutable. Normalised because that is what every variation table is written in and converting once is cheaper than converting per glyph; in axis order because the tables index axes positionally rather than by tag; and immutable because this is about to become part of two cache keys, and a mutable key is a cache that answers questions about a state it is no longer in.
⚠ None is not "the default instance", it is "not a variable font". They produce identical outlines and must not produce identical cache entries: a font with no fvar has one instance for ever, and a variable font sitting at its defaults is one axis-set away from being something else. Keeping them distinct costs a field and removes a class of stale-entry bug that only appears once something animates an axis.
Fields and properties (3)
public static readonly FontVariation NoneA font that is not variable, or is not being varied.
public ImmutableArray<float> CoordinatesThe normalised coordinates, one per axis.
public bool IsNoneWhether this is the "not varied" position.
Methods (5)
public FontVariation(ImmutableArray<float> coordinates)Creates a position from already-normalised coordinates.
public bool Equals(FontVariation? other)Indicates whether the current object is equal to another object of the same type.
public override bool Equals(object? obj)Determines whether the specified object is equal to the current object.
public override int GetHashCode()Serves as the default hash function.
public static FontVariation Create(ImmutableArray<FontAxis> axes, ImmutableArray<AxisSegmentMap> maps, IReadOnlyDictionary<string, float> values)Normalises a set of user-space axis values against a font's axes and avar.
Used by (10)
- FontFaceVixen.Ui.Text
- FontVariationTestsVixen.Ui.Text.Tests
- GlyfOutlinesVixen.Ui.Text
- GlyphKeyVixen.Ui.Text
- GlyphOutlineSourceVixen.Ui.Text
- GlyphVariationsVixen.Ui.Text
- KeyVixen.Ui.Text
- ShapingCacheVixen.Ui.Text
- TextShaperVixen.Ui.Text
- VariationConformanceTestsVixen.Ui.Text.Tests