FontVariation class
An axis tag and value that can be used to customize variable fonts.
Some fonts are variable fonts that can generate a range of different font faces by altering the values of the font's design axes.
For example:
const TextStyle(fontVariations: <ui.FontVariation>[ui.FontVariation('wght', 800.0)]) Font variations are distinct from font features, as exposed by the FontFeature class. Where features can be enabled or disabled in a discrete manner, font variations provide a continuous axis of control.
See also:
-
learn.microsoft.com/en-us/typography/opentype/spec/dvaraxisreg#registered-axis-tags, which lists registered axis tags.
-
docs.microsoft.com/en-us/typography/opentype/spec/otvaroverview, an overview of the font variations technology.
Constructors
- FontVariation(String axis, double value)
- Creates a FontVariation object, which can be added to a TextStyle to change the variable attributes of a font. const
- FontVariation.italic(double value)
- Variable font style. (
ital)const - FontVariation.opticalSize(double value)
- Optical size optimization. (
opzs)const - FontVariation.slant(double value)
- Variable font width. (
slnt)const - FontVariation.weight(double value)
- Variable font weight. (
wght)const - FontVariation.width(double value)
- Variable font width. (
wdth)const
Properties
Methods
- noSuchMethod(
Invocation invocation) → dynamic - Invoked when a nonexistent method or property is accessed. inherited
- toString(
) → String - A string representation of this object. override
Operators
- operator ==(
Object other) → bool - The equality operator. override
Static Methods
- lerp(
FontVariation? a, FontVariation? b, double t) → FontVariation? - Linearly interpolates between two font variations.