AsciiArt::FlfFont
Parsed representation of a FIGlet font (.flf file).
The .flf format (FIGfont version 2) is a plain-text container
specifying a header line, a multi-line comment, and one block of
height lines per glyph. Glyphs are stored in this fixed order:
- printable ASCII 32..126 (95 glyphs, in code-point order)
- seven Latin-1 extras (U+00C4 Ä, U+00D6 Ö, U+00DC Ü, U+00E4 ä, U+00F6 ö, U+00FC ü, U+00DF ß) — required by spec
- zero or more "code-tagged" glyphs prefixed by their codepoint
Each glyph line ends with a "endmark" character (typically @)
which is repeated twice on the last line. The "hardblank" character
declared in the header (often $) is rendered as an actual space
at draw time but stops adjacent glyphs from being smushed together.
This v0.1 parser supports the printable ASCII range; Latin-1 extras are read but optional, code-tagged glyphs are skipped (used only by exotic fonts for non-Latin scripts).
Constructors
Instance methods
Distance from the top of the glyph to the baseline (the line most letters sit on). Exposed for callers that want to align multiple fonts vertically.
Comment block from the .flf header, joined by "\n". Useful for
--show-credits style output.
Returns the glyph for char, or nil when the font has no
rendering for that character. Callers typically substitute a
blank glyph (or a ?) when a character is missing.
Map from codepoint to glyph (each glyph = height strings of
equal width). Built lazily during parsing.
Character used to pad short lines inside a glyph; rendered as a real space at draw time. Distinct from a regular space so the font can encode "intentional blank columns" inside a glyph.
Direction: 0 = left-to-right (default), 1 = right-to-left. Right-to-left fonts mirror the layout but are not yet rendered specially in v0.1 (we just emit them in source order).