These docs describe changes that aren’t released yet. For the newest release, see the released docs.
unknown-axis
- Type: error
- Kind:
usage(the caller misused the API)
What happened
Font::instance was given a variation axis the font does not have.
Why
A static font has no axes; a variable font has the axes listed in FontInfo::axes (fvar).
How to fix
Check font.info().axes before choosing coordinates, or use a variable font.
Example
let bold = static_font.instance(&[(OpenTypeTag::WEIGHT, 700.0)])?; // unknown-axis: no wght axisData fields
font: the font’s PostScript name (untrusted: read from the font).tag: the axis tag that was asked for.