code wiki / _hdl_build / nx_vecfont_body_bench.nx

nx_vecfont_body_bench.nx

buildroot/runtime/_hdl_build/nx_vecfont_body_bench.nx

8212 B114 linesdepth 4pulls 6 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_vecfont_body_bench.nx -- decide the FONT arc with a measurement, not a guess. Renders the SAME lowercase phrase through the sovereign stroke-VECTOR font (nx_font -> aa_raster) at HEADLINE size and at BODY size, so we can see where the vector font wins (big = smooth curves shine) vs where it may lose (small = no hinting, could blur below the crisp AA bitmap). Outputs two PNGs to eyeball + OCR + AA-measure. This grounds "wire the vector font for headings, keep the bitmap for body" (the hybrid) with evidence. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_font.nx nx_aa_raster.nx nx_png_write.nx nx_vecfont_body_bench.nx

imports: nx_font.nxnx_aa_raster.nxnx_png_write.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main vb_puts vb_slen vb_render font_trig_init font_text font_sp_shift_disp font_sp_shift_geo font_sp_shift font_ws font_wdth font_emit font_emit_geo font_weight font_mod fe_ring fe_stroke geo_arc fe_stroke ↻ fe_stroke ↻ geo_earc fe_stroke ↻ font_weight ↻ font_mod ↻ font_ws ↻ font_wdth ↻ font_slant fe_stroke ↻ gs_disc fe_ring ↻ font_adv font_adv_em font_adv_em_base font_adv_em_base_geo font_ws ↻ font_wdth ↻ aa_render aa_inside aa_blit nx_png_write_rgb

structs

none

consts

10const K_MAGIC_400000: i64 = 400000
11const K_MAGIC_40000: i64 = 40000
12const K_MAGIC_1600: i64 = 1600
13const K_MAGIC_1400: i64 = 1400
14const K_MAGIC_1100: i64 = 1100
15const K_MAGIC_1500: i64 = 1500
16const K_MAGIC_1700: i64 = 1700
17const K_MAGIC_1550: i64 = 1550
18const K_MAGIC_1050: i64 = 1050
19const K_MAGIC_1250: i64 = 1250
20const K_MAGIC_2200: i64 = 2200

functions

22func vb_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: main
23func vb_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 1: main
24func vb_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
27func vb_render(text: *u8, n: i64, px: i64, W: i64, H: i64, path: *u8) -> i64
54func main() -> i64