Preparing search index...

    Class NamedInstanceInfo

    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.

    Lens Scripting Version 372

    //@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;
    }
    Index

    Properties

    coordinates: number[]

    Axis values for this instance, indexed to match Font#variationAxes.

    Lens Scripting Version 372

    name: string

    Instance name, for example "Condensed Bold".

    Lens Scripting Version 372

    Methods

    • 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 string

      Lens Scripting Version 372

    • Debug-friendly string, e.g. {name: "Bold", coordinates: [700, 100]}.

      Returns string

      Lens Scripting Version 372