Construct a new Font
from a given font file. The font is usable immediately, but text will
not be rendered until it loads completely.
SphereFS path of an RFN format font file.
SphereFS path of the file from which this Font
was constructed.
Height of a line of text as rendered using this font, in pixels.
The default font provided by the engine.
Render text to a surface using this font.
The surface on which to render.
X coordinate where the text will be drawn.
Y coordinate where the text will be drawn.
Text string to render.
Color of the text.
If the text is wider than wrapWidth
in pixels, it will be wrapped to
multiple lines automatically.
Get the width and height of a text as drawn with this font when using word wrapping.
The text to be measured.
Maximum width at which to wrap the text, in pixels.
A Size2D
object with the measured width and height of the text.
Get the height of a text as drawn with this font using a given wrapWidth
.
The text to be measured.
The maximum width at which to wrap the text, in pixels.
Get the width of a single line of text as drawn with this font.
The text to be measured.
The width of the text when rendered, in pixels.
Split a text into multiple lines by applying word wrapping and newlines.
The text string to process.
The maximum width at which to wrap the text, in pixels.
An array of strings, with each string being a new line of text.
Load a font in the background and construct a new Font
for it once it's ready.
SphereFS path of an RFN format font file.
A promise for a newly constructed Font
object.
Generated using TypeDoc
Represents a font in the RFN font format. This is a raster font format, so all text metrics are in pixels.