Preparing search index...

    Class Font

    A font asset used for rendering text.

    // Assign a Font to a Label
    //@input Component.Label label
    //@input Asset.Font font
    script.label.fontAsset = script.font;

    Hierarchy (View Summary)

    Index

    Properties

    customVariationStyles: CustomVariationStyle[]

    User-defined variation styles. See CustomVariationStyle. Populated via Font.createVariationStyle. Not applicable to static fonts.

    Lens Scripting Version 372

    []
    
    isVariableFont: boolean

    Returns true if this font is a variable font.

    Lens Scripting Version 372

    name: string

    The name of the Asset in Lens Studio.

    ""
    
    namedInstances: NamedInstanceInfo[]

    Named instance info for this font. Empty for static fonts. See NamedInstanceInfo.

    Lens Scripting Version 372

    uniqueIdentifier: string

    Lens Scripting Version 176

    variationAxes: VariationAxisInfo[]

    Variation axes of this font. Empty for static fonts. See VariationAxisInfo.

    Lens Scripting Version 372

    Methods

    • Create a new CustomVariationStyle bound to this font, append it to Font.customVariationStyles, and return it. Throws if called on a static font.

      name must be non-empty and must not collide (case-, whitespace-, and hyphen-insensitive) with a FontStyles constant (e.g. FontStyles.Bold), a named instance on this font, or an existing custom variation style. Returns null when the name is invalid.

      Parameters

      • name: string

      Returns CustomVariationStyle

      Lens Scripting Version 372

      //@input Asset.Font fontAsset
      //@input Component.Text text
      var style = script.fontAsset.createVariationStyle("CustomStyle");
      style.weight = 565;
      style.GRAD = 14;
      script.text.preferredStyle = style.name;
    • 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

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object matches or derives from the passed in type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

      Parameters

      Returns boolean