nx_cdmap_export.nx
buildroot/runtime/nx_cdmap_export.nx
about
nx_cdmap_export.nx -- EXPORT A COMPARE PAGE'S POSITION MAP AS A STANDALONE SVG AND A PNG (datavis DV6, 2026-09-15).
Composes nx_cdmap_raster_lib: the page's :root colour tokens are read, the inline <svg class='cdmap'> is sliced,
written as a self-contained SVG (namespace declared, every var(--nx-color-*) resolved to the rgb the page defined) and
rasterised through the sovereign font engine and PNG writer at an integer scale. Every element class the figure carries
is COUNTED on the receipt line, and every construct outside the drawn subset is counted too (skipped, unresolved
colours, rotations the subset does not draw), so a reader can tell a complete render from a partial one by reading
the line, never by opening the picture. The receipt's LAST token is the verdict.
nx_cdmap_export <index.html> <out.svg> <out.png> [regular.ttf [bold.ttf [scale]]]
Fonts default to the Liberation Sans faces probed at the NAS path, the buildroot-relative path and the laptop path.
Exit 0 = both files landed, 1 = refused (the code is named), 2 = usage. license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_cdmap_raster_lib.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 14 | const XP_EXIT_OK: i64 = 0 |
| 15 | const XP_EXIT_REFUSED: i64 = 1 |
| 16 | const XP_EXIT_USAGE: i64 = 2 |
| 17 | const XP_ARGS_MIN: i64 = 4 |
| 18 | const XP_A_PAGE: i64 = 1 |
| 19 | const XP_A_SVG: i64 = 2 |
| 20 | const XP_A_PNG: i64 = 3 |
| 21 | const XP_A_FREG: i64 = 4 |
| 22 | const XP_A_FBOLD: i64 = 5 |
| 23 | const XP_A_SCALE: i64 = 6 |
| 24 | const XP_LINE_BYTES: i64 = 1024 |
| 25 | const XP_FONT_NAS: *u8 = "knowledge/fonts/LiberationSans-Regular.ttf" |
| 26 | const XP_FONT_NAS_BOLD: *u8 = "knowledge/fonts/LiberationSans-Bold.ttf" |
| 27 | const XP_FONT_UP: *u8 = "../knowledge/fonts/LiberationSans-Regular.ttf" |
| 28 | const XP_FONT_UP_BOLD: *u8 = "../knowledge/fonts/LiberationSans-Bold.ttf" |
| 29 | const XP_FONT_LAPTOP: *u8 = "web_assets/fonts/LiberationSans-Regular.ttf" |
| 30 | const XP_FONT_LAPTOP_BOLD: *u8 = "web_assets/fonts/LiberationSans-Bold.ttf" |
| 31 | const XP_CH_0: i64 = 48 |
| 32 | const XP_CH_9: i64 = 57 |
| 33 | const XP_BASE10: i64 = 10 |
functions
| 35 | func xp_put(s: *u8) -> i64 { sys_write(1, s, rs_slen(s)); return 0 } |
| 36 | func xp_kv(k: *u8, v: i64) -> i64 |
| 48 | func xp_ks(k: *u8, v: *u8) -> i64 { xp_put(" " as *u8); xp_put(k); xp_put("=" as *u8); xp_put(v); return 0 } |
| 49 | func xp_atoi(s: *u8) -> i64 called by 1: main |
| 55 | func xp_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 57 | func xp_font(argv: *i64, argc: i64, idx: i64, nas: *u8, up: *u8, laptop: *u8) -> *u8 |
| 64 | func main(argc: i64, argv: *i64) -> i64 |