Skip to content

textmode.js / TextmodeFont

Class: TextmodeFont

Manages the font used for rendering characters.

This class coordinates font loading, character extraction, texture atlas creation, and provides character information.

Accessors

characters

Get Signature

ts
get characters(): TextmodeCharacter[];

Returns the array of TextmodeCharacter objects in the font.

Returns

TextmodeCharacter[]


fontSize

Get Signature

ts
get fontSize(): number;

Returns the font size used for rendering.

Returns

number


maxGlyphDimensions

Get Signature

ts
get maxGlyphDimensions(): object;

Returns the maximum dimensions of a glyph in the font.

Returns

object

NameType
heightnumber
widthnumber

textureColumns

Get Signature

ts
get textureColumns(): number;

Returns the number of columns in the texture atlas.

Returns

number


textureRows

Get Signature

ts
get textureRows(): number;

Returns the number of rows in the texture atlas.

Returns

number

Methods

getGlyphData()

ts
getGlyphData(codePoint): null | GlyphData;

Lazily retrieves glyph data for the given Unicode code point. Glyph data is cached after the first access to avoid repeated Typr parsing.

Parameters

ParameterTypeDescription
codePointnumberUnicode code point

Returns

null | GlyphData

Parsed glyph data or null if unavailable