code wiki / (root) / nx_glyph_stroke.nx

nx_glyph_stroke.nx

buildroot/runtime/nx_glyph_stroke.nx

13384 B286 linesdepth 2pulls 4 transitivereach 100 importersview sourcekind librarytopic glyph
docsdependenciesstructsconstsfunctions

about

nx_glyph_stroke.nx -- RUNG 1 of the sovereign FONT BUILDER: the STROKE PEN. A glyph stroke is a centerline polyline + a width; this renders it as a filled thick outline (perpendicular-offset segment quads + round joins/caps as discs), all wound the SAME way so the AA rasterizer's nonzero fill UNIONS them into one smooth shape. Curves are just a curved centerline -> the hard letters (s, arches) become easy, and it's the natural unit for CJK strokes/radicals (the path to kanji). No floats: integer isqrt for the perpendicular. ORIGINAL.

dependencies 2 imports · 4 importers

nx_syscalls.nx nx_vecmath.nx nx_glyph_stroke.nx nx_font.nx nx_font_test.nx nx_glyph_compose.nx nx_glyph_word.nx

imports: nx_syscalls.nxnx_vecmath.nx

imported by: nx_font.nxnx_font_test.nxnx_glyph_compose.nxnx_glyph_word.nx

structs

none

consts

8const K_MAGIC_250000: i64 = 250000

functions

11func gs_isqrt(n: i64) -> i64 { return vm_isqrt(n) }
14func gs_seg(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, x0: i64, y0: i64, x1: i64, y1: i64, w: i64) -> i64
called by 2: gs_strokegs_stroke_mod2 calls 1: gs_isqrt
35func _gs_rnd1000(v: i64) -> i64 { if v >= 0 { return (v + 500) / 1000 } return 0 - ((500 - v) / 1000) }
called by 1: gs_disc
36func gs_disc(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, cx: i64, cy: i64, r: i64, rev: i64) -> i64
56func gs_stroke(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64, ptsx: *i64, ptsy: *i64, n: i64, w: i64) -> i64
called by 2: put_tstrokeput_stroke calls 2: gs_seggs_disc
82func gs_stroke_mod2(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64, cs: *i64, sn: *i64,
123func gs_area2(px: *i64, py: *i64, n: i64) -> i64
131func gs_emit_oriented(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64,
called by 1: gs_stroke_var calls 1: gs_area2
156func gs_stroke_var(xs: *i64, ys: *i64, cstart: *i64, clen: *i64, np: *i64, nc: *i64,
268func gs_init_trig(cs: *i64, sn: *i64) -> i64
called by 3: mainmainmain