NamedInstanceInfo
ClassRead-only named axis preset from the font's fvar table, for example "Condensed Bold".
- Available on all platforms
Since Lens Scripting v372
Read-only named axis preset from the font's fvar table, for example "Condensed Bold".
Returned from Font#namedInstances. Apply one by setting a
Text#preferredStyle on a Text component to the instance's NamedInstanceInfo#name.
Index
Properties
Methods
Example
//@input Asset.Font fontAsset
//@input Component.Text text
var instances = script.fontAsset.namedInstances;
for (var i = 0; i < instances.length; ++i) {
print(instances[i].name + " -> [" + instances[i].coordinates.join(", ") + "]");
}
if (instances.length > 0) {
script.text.preferredStyle = instances[0].name;
}
Properties
coordinates
readonlycoordinates:number[]
Axis values for this instance, indexed to match Font#variationAxes.
Since
Lens Scripting Version 372
name
readonlyname:string
Instance name, for example "Condensed Bold".
Since
Lens Scripting Version 372
Methods
getTypeName()
staticgetTypeName():TypeName<NamedInstanceInfo>
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<NamedInstanceInfo>
Since
Lens Scripting Version 372
toString()
toString():
string
Debug-friendly string, e.g. {name: "Bold", coordinates: [700, 100]}.
Returns
string
Since
Lens Scripting Version 372