--- layout: posts title: Api - Text Class ---

Hierarchy

Implements

Index

Constructors

Properties

Methods

Constructors

constructor

  • new Text(font: Font, text: string, fontSize: number, combine?: boolean, centerCharacterOrigin?: boolean, bezierAccuracy?: number, opentypeOptions?: RenderOptions): Text
  • Renders text in a given font to a model.

    Parameters

    • font: Font

      OpenType.Font object.

    • text: string

      String of text to render.

    • fontSize: number

      Font size.

    • Default value combine: boolean = false

      Flag (default false) to perform a combineUnion upon each character with characters to the left and right.

    • Default value centerCharacterOrigin: boolean = false

      Flag (default false) to move the x origin of each character to the center. Useful for rotating text characters.

    • Optional bezierAccuracy: number

      Optional accuracy of Bezier curves.

    • Optional opentypeOptions: RenderOptions

      Optional opentype.RenderOptions object.

    Returns Text

    Model of the text.

Properties

models

models: IModelMap

Methods

Static glyphToModel

  • glyphToModel(glyph: Glyph, fontSize: number, bezierAccuracy?: number): IModel

Generated using TypeDoc