Font Definition¶
The game’s fonts: one advance width per character code, and a sprite per glyph.
FontDefinition.Create¶
function TFontDefinition.Create(hashName: Integer; const fontData, spriteData: TByteArray): TFontDefinition; static;
Builds a font out of the two archives that make one up: the metrics, and the sprite sheet whose frames are the glyphs.
fontData is exactly 257 bytes - one advance width per character code, then the ascent - and
anything else raises.
FontDefinition.GetGlyphImage¶
function TFontDefinition.GetGlyphImage(charCode: Integer): TImage;
The glyph drawn for charCode as an image. A code the font has no glyph for raises.
Every glyph comes back on a canvas as wide as its advance and as tall as the font’s MaxHeight,
placed at its OffsetX, OffsetY, so glyphs laid side by side are spaced like the game draws
them and share a baseline.
FontDefinition.GetGlyphShadowImage¶
function TFontDefinition.GetGlyphShadowImage(charCode: Integer): TImage;
Like TFontDefinition.GetGlyphImage but with the game’s drop shadow drawn one pixel down and to the right of the glyph. The canvas is one pixel taller so the shadow is never clipped at the bottom, but keeps the glyph’s advance as its width.
FontDefinition.GetGlyphImages¶
function TFontDefinition.GetGlyphImages(): TImageArray;
function TFontDefinition.GetGlyphShadowImages(): TImageArray;
The printable glyphs indexed by character code, from TFontDefinition.GetGlyphImage or
TFontDefinition.GetGlyphShadowImage. Space is a blank image as wide as its advance.
Codes 0..31 and 96 are left empty.