Skip to main content

FontManager

Manages font loading and creates Three.js text meshes for annotation labels.

Constructors

new FontManager()

new FontManager(): FontManager

Owned by DrawingEditor and shared across all built-in tools.

Returns

FontManager

Methods

createTextMesh()

createTextMesh(text, fontSize, color, opacity): null | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>

Creates a text mesh in the XZ plane (rotation.x = -π/2). Returns null if the font is not yet loaded.

Parameters

ParameterTypeDefault value
textstringundefined
fontSizenumberundefined
colornumberundefined
opacitynumber1

Returns

null | Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>