code wiki / (root) / nx_font.nx

nx_font.nx

buildroot/runtime/nx_font.nx

72383 B1392 linesdepth 3pulls 4 transitivereach 94 importersview sourcekind librarytopic font
docsdependenciesstructsconstsfunctions

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

nx_glyph_stroke.nx nx_aa_raster.nx nx_font.nx nx_browser_render.nx nx_font_advdiff.nx nx_font_family_gate.nx nx_font_screen_tiers.nx nx_font_space_tool.nx nx_font_specimen.nx nx_font_test.nx nx_layout_block.nx nx_vecfont_body_bench.nx nx_vecphrase_proof.nx

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

27func 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 }
called by 3: maints_rendermain
28func font_spec_mod(m: i64) -> i64 { fs_mod=m; return 0 }
29func font_spec_swell(s: i64) -> i64 { fs_swell=s; return 0 }
30func font_spec_slant(s: i64) -> i64 { fs_slant=s; return 0 }
called by 2: mainmain
31func 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 }
32func font_mod() -> i64 { if fs_mod > 0 { return fs_mod } return 88 }
33func font_swell() -> i64 { if fs_swell > 0 { return fs_swell } return 126 }
called by 1: fe_stroke
34func font_slant() -> i64 { return fs_slant }
called by 2: fe_strokefont_emit
35func font_spec_geo(g: i64) -> i64 { fs_geo=g; return 0 }
36func font_spec_wdth(w: i64) -> i64 { fs_wdth=w; return 0 }
called by 2: mainmain
37func font_wdth() -> i64 { if fs_wdth <= 0 { return 100 } return fs_wdth }
42func font_weight() -> i64 { if fs_w > 0 { return fs_w } if fs_geo == 1 { return 91 } return 123 }
43func font_geo() -> i64 { return fs_geo }
48func geo_arc(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
called by 1: font_emit_geo calls 1: fe_stroke
71func geo_earc(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
called by 1: font_emit_geo calls 1: fe_stroke
97func font_ws() -> i64
107func fe_chaikin(sx: *i64, sy: *i64, n: i64, dx: *i64, dy: *i64) -> i64
125func fe_chaikin_cp(sx: *i64, sy: *i64, stag: *i64, n: i64, dx: *i64, dy: *i64, dtag: *i64) -> i64
called by 1: fe_stroke calls 1: gs_isqrt
171func fe_stroke(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
288func font_sp_shift(ch: i64) -> i64
359func font_adv_em_base(ch: i64) -> i64
called by 2: font_adv_emmain
444func font_sp_shift_geo(ch: i64) -> i64
called by 1: font_sp_shift_disp
519func font_adv_em_base_geo(ch: i64) -> i64
called by 1: font_adv_em
596func font_adv_em(ch: i64) -> i64
601func font_sp_shift_disp(ch: i64) -> i64 { if fs_geo == 1 { return font_sp_shift_geo(ch) } return font_sp_shift(ch) }
602func font_adv(ch: i64, S: i64) -> i64 { return (font_adv_em(ch) * S) / 1000 }
called by 1: font_text calls 1: font_adv_em
607func font_emit_geo(ch: i64, xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
734func font_emit(ch: i64, xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
1273func fe_ring(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
called by 2: font_emit_geofont_emit calls 1: fe_stroke
1290func font_has(ch: i64) -> i64
1307func font_run_has(text: *u8, len: i64) -> i64
called by 1: br_draw_fb_at calls 1: font_has
1314func font_has_ext(ch: i64) -> i64
called by 1: font_run_has_ext calls 1: font_has
1325func font_run_has_ext(text: *u8, len: i64) -> i64
1333func font_trig_init(cs: *i64, sn: *i64) -> i64
1353func font_vec_adv_px(ch: i64, sc: i64) -> i64 { return (font_adv_em(ch) * 15 * sc) / 1000 }
1354func font_vec_text_w(text: *u8, start: i64, end: i64, sc: i64) -> i64
calls 1: font_vec_adv_px
1360func font_vec_next_break(text: *u8, len: i64, avail_px: i64, start: i64, sc: i64) -> i64
calls 1: font_vec_adv_px
1379func font_text(text: *u8, len: i64, xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64,