code wiki / (root) / nx_font_1bpp.nx

nx_font_1bpp.nx

buildroot/runtime/nx_font_1bpp.nx

4069 B115 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind librarytopic font
docsdependenciesstructsconstsfunctions

about

nx_font_1bpp.nx -- bitmap font (caller-supplied glyph data). Substrate-layer font primitive. Caller supplies the glyph bytes (e.g., a public-domain 5x7 monospace ASCII font), substrate provides the lookup + bounds-checking. Designed for SSD1306-class 1bpp displays where 5x7 = 35 bits = 5 bytes per glyph (with vertical-byte layout matching the framebuffer). Glyph layout: each glyph_width column is one byte (top bit = top pixel for fonts up to height 8). For height > 8, multiple bytes per column (caller arranges). Composes: nx_fb_1bpp -- destination framebuffer nx_text_render -- draws strings using this font primitive V1 ships: - struct NxFont with caller-allocated glyph data - new + glyph_at for lookup - glyph_width / glyph_height getters Gap list: - no variable-width font support yet (monospace V1) - no anti-aliasing (1bpp by design) - no UTF-8 (ASCII only V1)

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_tier.nx nx_font_1bpp.nx nx_font_1bpp_test.nx nx_game_engine_compose_test.nx nx_text_render.nx nx_text_render_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_font_1bpp_test.nxnx_game_engine_compose_test.nxnx_text_render.nxnx_text_render_test.nx

structs

36struct NxFont

consts

30const NX_FT_OK: nx_int = 0
31const NX_FT_ERR_BAD_CHAR: nx_int = 1
32const NX_FT_ERR_BAD_DIM: nx_int = 2

functions

45func nx_font_new(glyph_data: *u8,
called by 3: mainmainmain calls 1: sys_mmap
69func nx_font_glyph_at(f: *NxFont, ch: nx_int) -> *u8
77func nx_font_has_char(f: *NxFont, ch: nx_int) -> nx_int
84func nx_font_glyph_width(f: *NxFont) -> nx_size
88func nx_font_glyph_height(f: *NxFont) -> nx_size
92func nx_font_bytes_per_glyph(f: *NxFont) -> nx_size
102func nx_font_glyph_pixel(f: *NxFont, ch: nx_int,