Preparing search index...

    Groups multiple Font assets into a single family, mapping each to a style (weight + italic).

        const model = this.pluginSystem.findInterface(Editor.Model.IModel) as Editor.Model.IModel;
    const scene = model.project.scene;
    const family = model.project.assetManager.assets.find((a) => a.isOfType('FontFamily')) as
    | Editor.Assets.FontFamily
    | undefined;

    const obj = scene.createSceneObject('Greeting');
    const text = obj.addComponent('Text');
    text.text = 'Hello, world';
    text.size = 48;
    if (family && !Editor.isNull(family)) {
    text.fontSource = family;
    console.log(`Text using FontFamily "${family.name}"`);
    } else {
    console.log('No FontFamily asset found; using default font');
    }

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    bold: Font

    Font asset assigned to the bold (weight ~700) style slot of this family.

    boldItalic: Font

    Font asset assigned to the bold italic style slot of this family.

    cacheFile: Path

    Path to the cached asset file.

    entries: FontFamilyEntry[]

    Per-style entries defining which Font asset is used for each weight and italic combination in this family.

    extraBold: Font

    Font asset assigned to the extra bold (weight ~800) style slot of this family.

    extraBoldItalic: Font

    Font asset assigned to the extra bold italic style slot of this family.

    extraLight: Font

    Font asset assigned to the extra light (weight ~200) style slot of this family.

    extraLightItalic: Font

    Font asset assigned to the extra light italic style slot of this family.

    familyName: string

    Display name of the font family.

    Import metadata for the asset.

    heavy: Font

    Font asset assigned to the heavy (weight ~900) style slot of this family.

    heavyItalic: Font

    Font asset assigned to the heavy italic style slot of this family.

    id: Uuid

    The unique id of the entity.

    light: Font

    Font asset assigned to the light (weight ~300) style slot of this family.

    lightItalic: Font

    Font asset assigned to the light italic style slot of this family.

    medium: Font

    Font asset assigned to the medium (weight ~500) style slot of this family.

    mediumItalic: Font

    Font asset assigned to the medium italic style slot of this family.

    meta: Meta

    Metadata associated with this entity, providing access to its unique identifier and other descriptive properties.

    name: string

    The name of the asset.

    regular: Font

    Font asset assigned to the regular (weight ~400) style slot of this family.

    regularItalic: Font

    Font asset assigned to the regular italic style slot of this family.

    semiBold: Font

    Font asset assigned to the semi bold (weight ~600) style slot of this family.

    semiBoldItalic: Font

    Font asset assigned to the semi bold italic style slot of this family.

    thin: Font

    Font asset assigned to the thin (weight ~100) style slot of this family.

    thinItalic: Font

    Font asset assigned to the thin italic style slot of this family.

    type: string

    The entity's type.

    Methods

    • Returns the type name of this class.

      Returns string

    • Returns the name of this object's type.

      Returns string

    • Returns true if the object is of the specified type.

      Parameters

      • type: string

      Returns boolean

    • Returns true if this object refers to the same instance as the given object.

      Parameters

      Returns boolean