code wiki / (root) / nx_font_bitmap_5x7.nx

nx_font_bitmap_5x7.nx

buildroot/runtime/nx_font_bitmap_5x7.nx

31197 B1019 linesdepth 2pulls 2 transitivereach 106 importersview sourcekind librarytopic font
docsdependenciesstructsconstsfunctions

about

nx_font_bitmap_5x7.nx -- 5x7 bitmap font for the Nishi browser. Phase 4 fifth primitive of NISHI_BROWSER_ROADMAP. Provides per-row glyph bit patterns; nx_paint_text (next primitive, queued) consumes these and rasterizes characters into a Framebuffer. Glyph layout: each glyph is 5 columns wide x 7 rows tall. One row is encoded as a single byte where the LOW 5 bits are the pixel pattern, LEFTMOST pixel = bit 4 (0x10), RIGHTMOST = bit 0 (0x01). Each glyph occupies 7 consecutive bytes in the font table. Initial subset (12 glyphs, 84 bytes of font data): ' ' (ASCII 32) -- space, all zero rows '0'..'9' (ASCII 48..57) -- digits '.' (ASCII 46) -- period Lookup contract: nx_font_5x7_glyph_row(ascii_char, row_idx) -> i64 ascii_char: byte value 0..255 row_idx: 0..6 (top to bottom) returns: low 5 bits = pixel pattern, -1 for unsupported char or row_idx out of range. Now covers: space, digits 0-9, A-Z, a-z, and common punctuation . , - : ; / ( ) ' " ! ? % + = (added for prose readability). What it does NOT handle yet (Phase 4b queued, explicit in header): - Remaining punctuation/symbols: # $ * @ [ ] { } < > \ | ~ ^ _ ` - Variable-width glyphs (current is fixed 5x7 cell) - Kerning pairs - Anti-aliasing (current is 1-bit-per-pixel) - Multi-byte encodings (UTF-8, Latin-1) - Synthetic bold / italic emphasis Per cardinal feedback-honest-perf-verdict-no-aspirational-claims: gap list is EXACT in this header. Glyph designs follow the classic IBM CGA 5x7 pattern (public- domain bitmap fonts derived from the original IBM PC ROM, e.g. the U+VT100, DOS-CGA, and Code Page 437 8x8 fonts).

dependencies 1 imports · 12 importers

nx_syscalls.nx nx_font_bitmap_5x7.nx nx_caption_burn.nx nx_caption_burn_gate.nx nx_eco_graph_png.nx nx_font_bitmap_5x7_test.nx nx_paint_text.nx nx_paint_text_test.nx nx_paint_walk_layout_text_test.nx nx_raster2d_lib.nx nx_render_ascii.nx nx_render_html.nx

diagram shows first 10 each side; +0 more imports, +2 more importers in the complete lists below.

imports: nx_syscalls.nx

imported by: nx_caption_burn.nxnx_caption_burn_gate.nxnx_eco_graph_png.nxnx_font_bitmap_5x7_test.nxnx_paint_text.nxnx_paint_text_test.nxnx_paint_walk_layout_text_test.nxnx_raster2d_lib.nxnx_render_ascii.nxnx_render_html.nxnx_render_wiki_bmp.nxnx_x11_paint_text_5x7.nx

structs

none

consts

55const NX_FONT_5X7_WIDTH: i64 = 5
56const NX_FONT_5X7_HEIGHT: i64 = 7

functions

63func nx_font_5x7_glyph_row(ascii_char: i64, row_idx: i64) -> i64