code wiki / _hdl_build / nx_brand_typescale.nx
nx_brand_typescale.nx
buildroot/runtime/_hdl_build/nx_brand_typescale.nx
about
nx_brand_typescale.nx -- R9 modular TYPE-SCALE generator. From a base size (milli-rem) + an integer ratio
(num/den, e.g. 5/4 = 1.25 "major third"), generate a modular scale of heading sizes as font tokens:
font|h1 = base * r^4 , font|h2 = base * r^2 , font|h3 = base * r^1 (rem)
NO-FLOAT (integer rational ^n, formatted to 3 decimal places). The generated scale is monotonic-descending and
lands inside the R2 type-scale band BY CONSTRUCTION, so bg_type_scale_ok passes. Output is a valid .brand
fragment (token|font|... lines) that feeds the token SSOT directly. REUSE: nx_brand_tokens (bt_app).
Library, no main. 100% sovereign. license_tier: ORIGINAL
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_brand_tokens.nx
imported by: nx_brand_exceed3_gate.nxnx_brand_typescale_gate.nx
structs
| none |
consts
| none |
functions
| 11 | func ts_ipow(base: i64, e: i64) -> i64 { var r: i64 = 1; var i: i64 = 0; while i < e { r = r * base; i = i + 1 } return r } called by 1: ts_size_milli |
| 13 | func ts_size_milli(base_milli: i64, num: i64, den: i64, n: i64) -> i64 |
| 19 | func ts_put_int(out: *u8, pos: i64, cap: i64, v: i64) -> i64 |
| 28 | func ts_fmt_rem(milli: i64, out: *u8, cap: i64) -> i64 |
| 42 | func ts_emit_one(out: *u8, pos: i64, cap: i64, name: *u8, milli: i64) -> i64 |
| 54 | func ts_emit_scale(base_milli: i64, num: i64, den: i64, out: *u8, cap: i64) -> i64 |