Skip to main content

VariationAxisInfo

Class

Read-only metadata describing one OpenType variation axis on a variable font.

  • Available on all platforms
Platform details: Snapchat, SPECS, Camera Kit Web, Camera Kit Mobile fully supported.

Platform details

  • Snapchat — Fully supported.

  • SPECS — Fully supported.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v372

Read-only metadata describing one OpenType variation axis on a variable font. Returned from Font#variationAxes.

Index

Example

//@input Asset.Font fontAsset

if (script.fontAsset.isVariableFont) {
var axes = script.fontAsset.variationAxes;
for (var i = 0; i < axes.length; i++) {
var axis = axes[i];
print(axis.name + " (" + axis.tag + "): " + axis.minValue +
" to " + axis.maxValue + ", default " + axis.defaultValue);
}
}

Properties

defaultValue

readonly defaultValue: number

Value the axis takes when no override is applied.

Since

Lens Scripting Version 372


maxValue

readonly maxValue: number

Highest value the axis accepts.

Since

Lens Scripting Version 372


minValue

readonly minValue: number

Lowest value the axis accepts.

Since

Lens Scripting Version 372


name

readonly name: string

Human-readable axis name from the font, for example "Weight".

Since

Lens Scripting Version 372


tag

readonly tag: string

Four-character OpenType axis tag, for example "wght" for weight.

Since

Lens Scripting Version 372

Methods

getTypeName()

static getTypeName(): TypeName<VariationAxisInfo>

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<VariationAxisInfo>

Since

Lens Scripting Version 372


toString()

toString(): string

Debug-friendly string, e.g. {tag: "wght", name: "Weight", min: 100, default: 400, max: 1000}.

Returns

string

Since

Lens Scripting Version 372