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:

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

axis String
The tag that identifies the design axis.
final
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value double
The value assigned to this design axis.
final

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.