Creates a new TextTexture and draws it immediately using already-available fonts (system
fonts, or fonts already registered via CSS @font-face/document.fonts). Use TextTexture.create
instead if options.fontUrl needs to be loaded first.
Configuration options.
The width-to-height ratio of the rendered text texture.
The unscaled (CSS pixel) height of the rendered text texture, useful for sizing a Plane.
The unscaled (CSS pixel) width of the rendered text texture, useful for sizing a Plane.
Merges new options in, redraws, and marks the texture for GPU re-upload.
Partial options to merge over the current configuration.
Replaces the displayed text and redraws, marking the texture for GPU re-upload.
The new text to display.
StaticcreateCreates a TextTexture, first loading options.fontUrl (if given) via the CSS Font Loading API.
Configuration options.
A promise that resolves to a new TextTexture instance.
StaticloadLoads a font file and registers it with document.fonts under the given family name.
The font family name to register the loaded font under.
The URL of the font file (e.g. a variable-font .woff2).
A promise that resolves to the loaded FontFace.
Renders text (including variable fonts and canvas-level effects) into a Texture, ready to be assigned as a material's diffuse map on a Plane. Call
setText/setOptionsto redraw and push the updated pixels to the GPU on the next frame.