code wiki / _hdl_build / nx_brand_typescale.nx

nx_brand_typescale.nx

buildroot/runtime/_hdl_build/nx_brand_typescale.nx

3283 B61 linesdepth 3pulls 3 transitivereach 2 importersview sourcekind librarytopic brand
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_brand_tokens.nx nx_brand_typescale.nx nx_brand_exceed3_gate.nx nx_brand_typescale_gate.nx

imports: nx_syscalls.nxnx_brand_tokens.nx

imported by: nx_brand_exceed3_gate.nxnx_brand_typescale_gate.nx

structs

none

consts

none

functions

11func 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
13func ts_size_milli(base_milli: i64, num: i64, den: i64, n: i64) -> i64
called by 2: ts_emit_scalemain calls 1: ts_ipow
19func ts_put_int(out: *u8, pos: i64, cap: i64, v: i64) -> i64
called by 1: ts_fmt_rem calls 1: sys_mmap
28func ts_fmt_rem(milli: i64, out: *u8, cap: i64) -> i64
called by 1: ts_emit_one calls 1: ts_put_int
42func ts_emit_one(out: *u8, pos: i64, cap: i64, name: *u8, milli: i64) -> i64
54func ts_emit_scale(base_milli: i64, num: i64, den: i64, out: *u8, cap: i64) -> i64
called by 2: mainmain calls 2: ts_emit_onets_size_milli