nx_font.nx
buildroot/runtime/nx_font.nx
about
nx_font.nx -- RUNG 4 of the sovereign font BUILDER: the FONT ENGINE. A char -> its stroke-composition (in
0..1000 em) + advance width; `font_text` lays out a string (pen advances per glyph). This is the table-driven
layer the browser calls. Glyphs are stroke-compositions (rung 1-3); growing the set = DATA. Subset here
(the letters for a demo phrase); the alphabet + kanji fill in the same way. ORIGINAL.
dependencies 2 imports · 10 importers
imports: nx_glyph_stroke.nxnx_aa_raster.nx
imported by: nx_browser_render.nxnx_font_advdiff.nxnx_font_family_gate.nxnx_font_screen_tiers.nxnx_font_space_tool.nxnx_font_specimen.nxnx_font_test.nxnx_layout_block.nxnx_vecfont_body_bench.nxnx_vecphrase_proof.nx
structs
| none |
consts
| none |
functions
| 27 | func font_spec(w: i64, over: i64, passes: i64, caps: i64) -> i64 { fs_w=w; fs_over=over; fs_passes=passes; fs_caps=caps; return 0 } |
| 28 | func font_spec_mod(m: i64) -> i64 { fs_mod=m; return 0 } |
| 29 | func font_spec_swell(s: i64) -> i64 { fs_swell=s; return 0 } |
| 30 | func font_spec_slant(s: i64) -> i64 { fs_slant=s; return 0 } |
| 31 | func font_spec_reset() -> i64 { fs_w=0; fs_over=0; fs_passes=0; fs_caps=0; fs_mod=0; fs_swell=0; fs_slant=0; fs_geo=0; fs_wdth=0; return 0 } |
| 32 | func font_mod() -> i64 { if fs_mod > 0 { return fs_mod } return 88 } |
| 33 | func font_swell() -> i64 { if fs_swell > 0 { return fs_swell } return 126 } called by 1: fe_stroke |
| 34 | func font_slant() -> i64 { return fs_slant } |
| 35 | func font_spec_geo(g: i64) -> i64 { fs_geo=g; return 0 } |
| 36 | func font_spec_wdth(w: i64) -> i64 { fs_wdth=w; return 0 } |
| 37 | func font_wdth() -> i64 { if fs_wdth <= 0 { return 100 } return fs_wdth } |
| 42 | func font_weight() -> i64 { if fs_w > 0 { return fs_w } if fs_geo == 1 { return 91 } return 123 } |
| 43 | func font_geo() -> i64 { return fs_geo } |
| 48 | func geo_arc(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, |
| 71 | func geo_earc(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, |
| 97 | func font_ws() -> i64 |
| 107 | func fe_chaikin(sx: *i64, sy: *i64, n: i64, dx: *i64, dy: *i64) -> i64 |
| 125 | func fe_chaikin_cp(sx: *i64, sy: *i64, stag: *i64, n: i64, dx: *i64, dy: *i64, dtag: *i64) -> i64 |
| 171 | func fe_stroke(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, called by 5: geo_arcgeo_earcfont_emit_geofont_emitfe_ring calls 9: fe_chaikin_cpfont_modgs_isqrtfont_wsfont_wdthfont_slant+3 |
| 288 | func font_sp_shift(ch: i64) -> i64 |
| 359 | func font_adv_em_base(ch: i64) -> i64 |
| 444 | func font_sp_shift_geo(ch: i64) -> i64 called by 1: font_sp_shift_disp |
| 519 | func font_adv_em_base_geo(ch: i64) -> i64 called by 1: font_adv_em |
| 596 | func font_adv_em(ch: i64) -> i64 |
| 601 | func font_sp_shift_disp(ch: i64) -> i64 { if fs_geo == 1 { return font_sp_shift_geo(ch) } return font_sp_shift(ch) } |
| 602 | func font_adv(ch: i64, S: i64) -> i64 { return (font_adv_em(ch) * S) / 1000 } |
| 607 | func font_emit_geo(ch: i64, xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, |
| 734 | func font_emit(ch: i64, xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, called by 3: bpv_cellfont_textmain calls 9: font_emit_geofont_weightfont_modfont_wsfont_wdthfont_slant+3 |
| 1273 | func fe_ring(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, |
| 1290 | func font_has(ch: i64) -> i64 |
| 1307 | func font_run_has(text: *u8, len: i64) -> i64 |
| 1314 | func font_has_ext(ch: i64) -> i64 |
| 1325 | func font_run_has_ext(text: *u8, len: i64) -> i64 |
| 1333 | func font_trig_init(cs: *i64, sn: *i64) -> i64 |
| 1353 | func font_vec_adv_px(ch: i64, sc: i64) -> i64 { return (font_adv_em(ch) * 15 * sc) / 1000 } |
| 1354 | func font_vec_text_w(text: *u8, start: i64, end: i64, sc: i64) -> i64 calls 1: font_vec_adv_px |
| 1360 | func font_vec_next_break(text: *u8, len: i64, avail_px: i64, start: i64, sc: i64) -> i64 calls 1: font_vec_adv_px |
| 1379 | func font_text(text: *u8, len: i64, xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, |