code wiki / (root) / nx_nishi_font_core.nx

nx_nishi_font_core.nx

buildroot/runtime/nx_nishi_font_core.nx

11637 B214 linesdepth 0pulls 0 transitivereach 29 importersview sourcekind librarytopic nishi
docsdependenciesstructsconstsfunctions

about

nx_nishi_font_core.nx -- the PURE, IMPORT-FREE core of the sovereign Nishi stroke font. Contains the glyph stroke designs + the supersampled-mask rasterizer + a BASE-RELATIVE i64-framebuffer blit that takes a CALLER-PROVIDED scratch mask (no sys_mmap) so it runs unchanged in our browser WASM (linear mem, base=0). NO imports -> compiles to clean WAT with no un-lowerable syscalls. The u8/PNG path (nf_render_glyph) + demo + gate live in nx_nishi_font.nx, which imports this. Monoline sans-serif, 4x supersample box AA, all integer (no float). Grid: x,y in EM units, EM height 28; cap-top y=4, baseline y=22. Glyph set: N I S H B R O W E + 0-9 + space. Every glyph DESIGNED here (no glyph copied from any font -> no license). license_tier: ORIGINAL

dependencies 0 imports · 12 importers

nx_nishi_font_core.nx nx_nishi_font.nx nx_wasm_2048.nx nx_wasm_adventure.nx nx_wasm_arcade.nx nx_wasm_city.nx nx_wasm_diablo.nx nx_wasm_platformer.nx nx_wasm_pong.nx nx_wasm_racing.nx nx_wasm_shmup.nx

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

imports: none

imported by: nx_nishi_font.nxnx_wasm_2048.nxnx_wasm_adventure.nxnx_wasm_arcade.nxnx_wasm_city.nxnx_wasm_diablo.nxnx_wasm_platformer.nxnx_wasm_pong.nxnx_wasm_racing.nxnx_wasm_shmup.nxnx_wasm_td.nxnx_wasm_thirdperson.nx

structs

none

consts

9const NF_SS: i64 = 4 // supersample factor
10const NF_EM: i64 = 28 // EM height in design units
11const NF_ADV_U: i64 = 20 // advance width in design units

functions

14func nf_u(u: i64, ch: i64) -> i64 { return u * ch * NF_SS / NF_EM }
called by 1: nf_us
17func nf_stamp(mask: *u8, mw: i64, mh: i64, cx: i64, cy: i64, r: i64) -> i64
called by 1: nf_seg
37func nf_seg(mask: *u8, mw: i64, mh: i64, x0: i64, y0: i64, x1: i64, y1: i64, r: i64) -> i64
called by 1: nf_us calls 1: nf_stamp
54func nf_us(mask: *u8, mw: i64, mh: i64, ux0: i64, uy0: i64, ux1: i64, uy1: i64, ch: i64, r: i64) -> i64
called by 1: nf_glyph calls 2: nf_segnf_u
60func nf_glyph(mask: *u8, mw: i64, mh: i64, gid: i64, ch: i64, r: i64) -> i64
149func nf_adv_px(ch: i64) -> i64 { return ch * NF_ADV_U / NF_EM }
155func nf_blit_glyph_mem(fb: *i64, fbw: i64, fbh: i64, mask: *u8, ox: i64, oy: i64, ch: i64, gid: i64, ink: i64) -> i64
called by 1: nf_draw_text_mem calls 1: nf_glyph
204func nf_draw_text_mem(fb: *i64, fbw: i64, fbh: i64, mask: *u8, ox: i64, oy: i64, ch: i64, s: *u8, slen: i64, ink: i64) -> i64