code wiki / (root) / nx_font_gen_census.nx

nx_font_gen_census.nx source

↩ module page · 87 lines · 7172 B

1// nx_font_gen_census.nx -- what does "S-CLASS EXCEED" mean for a FONT GENERATOR + ALL LANGUAGES? (operator asked 2// to use the researcher to define it). Grounded in the Nishi researcher's banked fg_*.raw (Metafont, Variable_font, 3// FontForge, Noto, Unicode, CJK/Han, Arabic, Devanagari, HarfBuzz). THE BAR (defined here): a SOVEREIGN PARAMETRIC 4// font GENERATOR that emits VARIABLE, pan-Unicode fonts with complex-script SHAPING -- matching Noto's coverage + 5// fontTools/HarfBuzz capability, but sovereign (no toolchain dependency) + reproducible. Honest map of where we are 6// after R0-R3 (a minimal sovereign TTF emitter + a parametric stroke seed). ABSENT cells = the generator+language 7// ladder. GROUNDED FACT: Unicode 17.0 encodes 101,000+ Han characters ALONE (fg_unicode.raw). license_tier: ORIGINAL expect_exit: 0 8import "nx_syscalls.nx" 9 10const G_ABSENT: i64 = 0 11const G_PRESENT: i64 = 1 12const G_PARITY: i64 = 2 13const G_EXCEEDS: i64 = 3 14 15func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 16func sn(v: i64) -> i64 { let bb: *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{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 } 17 18func grade_name(g: i64) -> i64 { 19 if g==G_ABSENT { sw("ABSENT " as *u8) } 20 if g==G_PRESENT { sw("PRESENT" as *u8) } 21 if g==G_PARITY { sw("PARITY " as *u8) } 22 if g==G_EXCEEDS { sw("EXCEEDS" as *u8) } 23 return 0 24} 25func cap_valid(grade: i64, has_ev: i64) -> i64 { if grade >= G_PARITY { if has_ev == 0 { return 0 } } return 1 } 26func row(p: *u8, cap: *u8, grade: i64, base: *u8, ev: *u8, has_ev: i64, tot: *i64) -> i64 { 27 sw(" " as *u8); sw(p); sw(" | " as *u8); sw(cap); sw(" -> " as *u8); grade_name(grade) 28 if cap_valid(grade, has_ev) == 0 { sw(" <== INVALID (LIAR-KILL)" as *u8); tot[4]=tot[4]+1 } 29 else { if has_ev == 1 { sw(" [have: " as *u8); sw(ev); sw("]" as *u8) } } 30 sw(" {bar: " as *u8); sw(base); sw("}\n" as *u8) 31 tot[grade] = tot[grade] + 1 32 return 0 33} 34 35func main() -> i64 { 36 let tot: *i64 = sys_mmap(64) as *i64 37 tot[0]=0; tot[1]=0; tot[2]=0; tot[3]=0; tot[4]=0 38 39 sw("=== nx_font_gen_census -- what S-CLASS EXCEED means for a FONT GENERATOR + ALL LANGUAGES (researched) ===\n" as *u8) 40 sw("THE BAR: sovereign PARAMETRIC generator -> VARIABLE, pan-Unicode fonts + complex SHAPING (Noto coverage +\n" as *u8) 41 sw("fontTools/HarfBuzz capability, but no toolchain dep). ABSENT = the ladder. GREEN = honest map, not a win.\n" as *u8) 42 43 sw("-- GEN PARAMETRIC GENERATOR (the 'generator, not one font' ask) --\n" as *u8) 44 row("GEN" as *u8, "parametric glyph model (params->outlines, not fixed)" as *u8, G_PRESENT, "Metafont: pens+params generate letterforms" as *u8, "nx_nishi_font_core stroke params (radius=weight, EM grid)" as *u8, 1, tot) 45 row("GEN" as *u8, "design AXES (weight/width/optical -> a family)" as *u8, G_PRESENT, "Metafont params / variable-font axes" as *u8, "nx_font_gen: weight param -> light/regular/bold, 3 self-validated .ttf from ONE stroke def" as *u8, 1, tot) 46 row("GEN" as *u8, "VARIABLE-font emit (fvar/gvar/avar, 1 file N styles)" as *u8, G_ABSENT, "OpenType variable fonts (one file, whole family)" as *u8, "" as *u8, 0, tot) 47 row("GEN" as *u8, "masters -> instances interpolation" as *u8, G_ABSENT, "designspace / MutatorMath" as *u8, "" as *u8, 0, tot) 48 49 sw("-- COV ALL-LANGUAGES COVERAGE (Noto = the 'no tofu' benchmark) --\n" as *u8) 50 row("COV" as *u8, "Latin uppercase A-Z (usable for real words)" as *u8, G_PRESENT, "full Latin also needs lowercase+digits+punct (authoring, no new capability)" as *u8, "nx_font_latin: full A-Z (26) self-validated .ttf, sets real English words" as *u8, 1, tot) 51 row("COV" as *u8, "Cyrillic + Greek (outline)" as *u8, G_ABSENT, "Noto Sans (bitmap-cyrillic exists; outline ABSENT)" as *u8, "" as *u8, 0, tot) 52 row("COV" as *u8, "E.Asian REACH: Chinese Han + Korean + Japanese kana" as *u8, G_PRESENT, "full coverage=101,000+ Han (Unicode 17.0); ours = REACH not coverage" as *u8, "nx_font_universal (Han+Hangul) + nx_font_diag (katakana via diagonal strokes)" as *u8, 1, tot) 53 row("COV" as *u8, "Arabic + Hebrew (RTL)" as *u8, G_ABSENT, "Noto Arabic (joining forms + RTL)" as *u8, "" as *u8, 0, tot) 54 row("COV" as *u8, "Indic (Devanagari etc.)" as *u8, G_ABSENT, "Noto Devanagari (conjuncts + reordering)" as *u8, "" as *u8, 0, tot) 55 row("COV" as *u8, "pan-Unicode breadth (every script)" as *u8, G_ABSENT, "Noto: ~all modern+historic scripts ('no tofu')" as *u8, "" as *u8, 0, tot) 56 57 sw("-- SHP COMPLEX-TEXT SHAPING (HarfBuzz = the bar) --\n" as *u8) 58 row("SHP" as *u8, "GSUB (ligatures / contextual substitution)" as *u8, G_ABSENT, "OpenType GSUB via HarfBuzz" as *u8, "" as *u8, 0, tot) 59 row("SHP" as *u8, "GPOS (kerning / mark positioning)" as *u8, G_ABSENT, "OpenType GPOS" as *u8, "" as *u8, 0, tot) 60 row("SHP" as *u8, "bidi + Arabic joining + Indic reordering" as *u8, G_ABSENT, "HarfBuzz complex-script shaping" as *u8, "" as *u8, 0, tot) 61 62 sw("-- FMT + SOV (formats + the sovereignty EXCEED axis) --\n" as *u8) 63 row("FMT" as *u8, "TrueType file emit" as *u8, G_PRESENT, "fontTools/FontForge emit" as *u8, "nx_font_ttf_emit: nishi.ttf self-validated" as *u8, 1, tot) 64 row("FMT" as *u8, "OTF(CFF) / WOFF2 web-compressed" as *u8, G_ABSENT, "WOFF2 (Brotli) / CFF outlines" as *u8, "" as *u8, 0, tot) 65 row("SOV" as *u8, "SOVEREIGN gen+emit (no fontTools/FontForge/HarfBuzz)" as *u8, G_PRESENT, "Noto is built ON fontTools+HarfBuzz (a toolchain dep)" as *u8, "nx_font_ttf_emit: sovereign TTF, zero toolchain (exceed AXIS once gen+shape land)" as *u8, 1, tot) 66 67 sw("--- DISTRIBUTION ---\n" as *u8) 68 sw(" ABSENT=" as *u8); sn(tot[0]); sw(" PRESENT=" as *u8); sn(tot[1]); sw(" PARITY=" as *u8); sn(tot[2]); sw(" EXCEEDS=" as *u8); sn(tot[3]) 69 let total: i64 = tot[0]+tot[1]+tot[2]+tot[3] 70 sw(" TOTAL=" as *u8); sn(total); sw(" invalid=" as *u8); sn(tot[4]); sw("\n" as *u8) 71 72 var neg_ok: i64 = 1 73 if cap_valid(G_EXCEEDS, 0) != 0 { neg_ok = 0 } 74 if cap_valid(G_PRESENT, 0) != 1 { neg_ok = 0 } 75 sw(" NEG-CONTROL liar-kill fires: " as *u8); if neg_ok==1 { sw("YES\n" as *u8) } else { sw("NO\n" as *u8) } 76 sw(" READ: s-class-exceed HERE = the FULL sovereign stack (parametric gen -> variable emit -> pan-Unicode\n" as *u8) 77 sw(" coverage -> complex shaping), which NO ONE does sovereignly (Noto/everyone depends on fontTools+HarfBuzz).\n" as *u8) 78 sw(" We have the FOUNDATION (parametric seed + sovereign TTF emit); the ladder is long + honest. Build order:\n" as *u8) 79 sw(" GEN-axes -> variable emit -> full Latin -> GSUB/GPOS shaping -> Cyrillic/Greek -> Arabic/Indic (shaping) -> CJK (scale).\n" as *u8) 80 81 var green: i64 = 0 82 if tot[4] == 0 { if neg_ok == 1 { green = 1 } } 83 if green == 1 { sw("VERDICT: GREEN (honest bar + map; foundation PRESENT, no self-scored win; the ladder is the plan)\n" as *u8); sys_exit(0) } 84 sw("VERDICT: RED\n" as *u8) 85 sys_exit(1) 86 return 1 87}