FontRenderer

The base class for all font faces. Internally, fonts can be either SVG or OpenType. To instantiate a font, use

const myFont = getFontFromURL(font);

where font is the url parameter chosen by the font picker.

Constructors

FontRenderer is an abstract type and cannot be instantiated its own.

Properties

.ascenderHeightnumber

The maximum height above the baseline of any glyph in the font. This value is a scale relative to the font size.

.descenderHeightnumber

The maximum height below the baseline of any glyph in the font. This value is a scale relative to the font size.

.isSingleLineboolean

Most fonts are designed as filled shapes, but some are designed to be used as open paths or "single line" fonts.

Methods

.glyphsFromString(text,renderOptions)FontGlyph[]

Use when modifier will layout each glyph. Should not include newlines. Accepts string or RichText.

text
unknown
renderOptions
{}
.renderLine(textString,renderOptions)RenderLineResult

A single line of text that should not include newlines.

textString
(string | RichText)
renderOptions
{}
.render(text,renderOptions)RenderLineResult[]

Use when modifier will layout each line. Can include newlines. Casts input to string or RichText.

text
unknown
renderOptions
{}