Class: FontBuilder

The FontBuilder class provides methods for constructing fonts and generating surfaces and curves from text.

Constructors

new FontBuilder()

new FontBuilder(): FontBuilder

Returns

FontBuilder

Methods

text()

static text(plane, text, size, font, letterSpacing?, lineHeight?): object

Generates a TSDoc comment for the text method.

Parameters

plane: Plane

The plane on which the text will be placed.

text: any

The text to be rendered.

size: number

The size of the text.

font: Font

The font to be used for rendering the text.

letterSpacing?: number

The spacing between letters (optional).

lineHeight?: number

The height of each line (optional).

Returns

object

An object containing the surface and curve shapes of the rendered text.

curveShape

curveShape: Curve

surfaceShape

surfaceShape: Surface

Throws

Error if the font is not loaded or if there are malformed characters in the text.