Class: FontBuilder
FontBuilder converts text into geometry -- surfaces and curves generated from font characters. All methods are static, so you call them directly on the class without instantiation.
When to use
- Adding text to 3D models -- place labels, part numbers, or branding on solid faces.
- Creating signage -- generate extrudable letter outlines for signs or displays.
- Engraving and embossing -- produce curve and surface geometry that can be used with boolean operations to cut or raise text on solids.
Quick start
Key methods
| Method | Description |
|---|---|
text(plane, text, size, font) | Generate surface and curve shapes from text on a given plane |
load(font) | Asynchronously load and parse a font from a URL |
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
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.