Class: FontBuilder
The FontBuilder class provides methods for constructing fonts and generating surfaces and curves from text.
Static Method: text
Creates a surface and curve shapes representing the rendered text.
Parameters
plane(IPlane): The plane on which the text will be placed.text(any): The text to be rendered.size(number): The size of the text.fontWrapper(IFont): The font to be used for rendering the text.
Returns
An object containing the surface and curve shapes of the rendered text.
Example
const plane = /* specify a plane */;
const text = /* specify a text */;
const size = 0.5;
const fontWrapper = /* specify a fontWrapper */;
FontBuilder.text(plane, text, size, fontWrapper);
Static Method: load
Asynchronously loads a font from the provided URL and parses it.
Parameters
font(IFont): The font object containing the URL and a method to set the parsed font.
Returns
Promise - void A promise that resolves when the font is loaded and parsed.
Example
const font = /* specify a font */;
FontBuilder.load(font);