# Text Renderer ## Current state `game/src/font.rs` — a CP437 bitmap font ported from the `wds` project. - Atlas: 32 columns × 8 rows of fixed cells, codepoint = index (`A` at 65 → column 1, row 2). Loaded with `Image::from_png`; the mask is derived from luminance (white on black), so the caller paints glyphs in any RGB565 color. - Proportional advance: on load the ink span of every glyph (leftmost/rightmost lit column) is measured. `draw` crops to that span and advances by ink width + 1 px tracking; blank glyphs (space) advance half a cell. - `cp437(char)` maps ASCII 1:1 and the accented letters the atlas has (ä ö ü ß …); everything else becomes `?`. - `text_width` and `wrap` (word wrap with hard `\n`) for layout. - Font in use: `assets/fonts/cga-8x8.png` (Oldschool PC Font Pack, CGA 8×8). ## Open questions - A second, smaller or larger font (the EGA 8×14 from `wds`) once the UI needs hierarchy. - Text color per span / inline markup for the log — not before it is needed.