code wiki / _hdl_build / nx_typequality_census.nx

nx_typequality_census.nx

buildroot/runtime/_hdl_build/nx_typequality_census.nx

10840 B172 linesdepth 10pulls 45 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_typequality_census.nx -- MEASURE typeface QUALITY vs Chrome's professional font (operator: legibility is proven but the type "is pretty good but still bad" -- so quantify the REAL quality gap, not just legibility/smoothness). Renders the SAME word ("Render legibility") in our vector font and in Chrome (Arial 600) at matched size; decodes both; measures the visible amateur-vs-pro tells: WEIGHT = ink density within the tight text bounding box (professional display type is BOLD/confident; ours was thin -> low). ratio = ours*1000/chrome. STROKE = average dark run-width (px) -- thin hairline strokes vs solid ones. This census is HONEST BY DESIGN: it REPORTS the gap (does not claim parity). C-tests assert the comparison exists + the metric discriminates (Chrome must read as heavier than a blank). The verdict is census integrity; the numbers speak. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_img_bytes_to_rgb.nx nx_typequality_census.nx

imports: nx_img_bytes_to_rgb.nx

imported by: nobody (leaf or entry point)

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

main tq_puts tq_load sys_read_file sys_openat_rd sys_lseek sys_mmap sys_read sys_close nx_img_bytes_to_rgb sys_mmap ↻ nx_jpeg_decode_rgb sys_mmap ↻ nx_jpeg_dec_ctx_init sys_mmap ↻ _jpeg_ascii_probe_sof sys_mmap ↻ nx_jpeg_seg_init nx_jpeg_seg_next nx_jpeg_classify_marker nx_jpeg_marker_is_lengthle nx_jpeg_sof_parse nx_jpeg_is_progressive prog_be16 nx_jpeg_prog_decode sys_mmap ↻ prog_be16 ↻ nx_jpeg_dqt_parse nx_jpeg_dht_parse nx_jpeg_dht_build_decode_t nx_jpeg_sos_parse prog_next_marker prog_scan sys_mmap ↻ nx_jpeg_huff_decode_symbol nx_jpeg_ent_extend nx_jpeg_ent_receive prog_refine_nz nx_jpeg_mcu_scratch_init sys_mmap ↻

structs

none

consts

12const K_MAGIC_2126: i64 = 2126
13const K_MAGIC_7152: i64 = 7152
14const K_MAGIC_10000: i64 = 10000

functions

16func tq_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
17func tq_num(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} 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 }
called by 1: main
18func tq_app(buf: *u8, pos: i64, s: *u8) -> i64 { var p: i64=pos; var i: i64=0; while s[i]!=(0 as u8) { buf[p]=s[i]; p=p+1; i=i+1 } return p }
called by 1: main
19func tq_appd(buf: *u8, pos: i64, v: i64) -> i64 { var p: i64=pos; var m: i64=v; if m<0 { buf[p]=45 as u8; p=p+1; 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 { buf[p]=t[k-1-i]; p=p+1; i=i+1 } return p }
called by 1: main
20func tq_write_file(path: *u8, data: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd<=0 { return 0 - 1 } sys_write(fd, data, n); sys_close(fd); return n }
called by 1: main calls 1: sys_openat_wr
21func tq_lum(rgb: *u8, o: i64) -> i64 { return (K_MAGIC_2126*(rgb[o] as i64) + K_MAGIC_7152*(rgb[o+1] as i64) + 722*(rgb[o+2] as i64))/K_MAGIC_10000 }
called by 2: tq_inktq_measure
22func tq_load(path: *u8, wh: *i64) -> *u8
30func tq_ink(rgb: *u8, w: i64, h: i64, x: i64, y: i64) -> i64
called by 1: tq_measure calls 1: tq_lum
42func tq_measure(rgb: *u8, w: i64, h: i64, out: *i64) -> i64
called by 1: main calls 2: tq_lumtq_ink
95func main() -> i64