skia
    Preparing search index...

    Interface Typeface

    See SkTypeface.h for more on this class. The objects are opaque.

    interface Typeface {
        _type: "Typeface";
        delete(): void;
        deleteLater(): void;
        getFamilyName(): string;
        getGlyphIDs(
            str: string,
            numCodePoints?: number,
            output?: GlyphIDArray,
        ): GlyphIDArray;
        getVariationAxes(): VariationAxis[];
        isAliasOf(other: any): boolean;
        isDeleted(): boolean;
        makeVariation(axes: { axis: string; value: number }[]): Typeface | null;
    }

    Hierarchy (View Summary)

    Index

    Properties

    _type: "Typeface"

    Methods

    • Return the typeface family name.

      Returns string

    • Retrieves the glyph ids for each code point in the provided string. Note that glyph IDs are typeface-dependent; different faces may have different ids for the same code point.

      Parameters

      • str: string
      • OptionalnumCodePoints: number

        the number of code points in the string. Defaults to str.length.

      • Optionaloutput: GlyphIDArray

        if provided, the results will be copied into this array.

      Returns GlyphIDArray

    • Returns all variation axes supported by this typeface as an array of VariationAxis objects. Returns an empty array for non-variable fonts.

      Returns VariationAxis[]

    • Returns a new typeface with the specified variation axes applied. Any axis not listed keeps its default value; unknown axes are ignored. Returns null if the typeface could not be cloned with the new settings.

      Parameters

      • axes: { axis: string; value: number }[]

        array of { axis: 4-char tag string, value: number }

      Returns Typeface | null