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
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
| Name | Type |
|---|---|
height | number |
width | number |
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
| Parameter | Type | Description |
|---|---|---|
codePoint | number | Unicode code point |
Returns
null | GlyphData
Parsed glyph data or null if unavailable