static-to-variable
v0.6.2
Published
Convert a family of static fonts into a single variable font, guided by a config and an audited pipeline.
Maintainers
Readme
static-to-variable
Turn static fonts into one variable font.
Got a font as thin, regular, and bold files? Point this at them and get back one file you can slide between. See rebuilt families at blode.co/static-to-variable — the CLI builds on your machine; nothing is uploaded.
Quick start
Go to a folder with your font files and run:
npm install -g static-to-variable
static-to-variable init
static-to-variable buildinit finds your fonts, reads their weights, and writes stv.config.json for you; confirm the list and name the family. In a non-interactive shell (CI, agents) it writes a starter template to edit instead.
Your variable font is in build/. Needs Node 24.11+, Python 3.11+, and uv; the bundled font engine sets itself up the first time you build. Run static-to-variable doctor to check your setup.
Commands
static-to-variable init # detect fonts, write ./stv.config.json
static-to-variable build # rebuild -> normalize -> build
static-to-variable release # finalize + WOFF2
static-to-variable split <font> # variable font -> static weights (the reverse)
static-to-variable doctor # environment readiness
static-to-variable --version
static-to-variable --helpbuild and release read ./stv.config.json by default; pass --config <path> to use another. Inside a repo checkout, list / run / step / status drive the advanced QA pipeline.
Split a variable font back into static weights
Already have a variable font and want the individual weights? split is the reverse of build: it pins the font at each step along its wght axis and writes one static TTF + WOFF2 per weight, each named so they install side by side.
static-to-variable split MyFamily-VF.ttf # -> ./static/*.ttf + *.woff2
static-to-variable split MyFamily-VF.ttf --out dist # choose the output directory
static-to-variable split MyFamily-VF.ttf --step 50 # finer weight steps (default 100)No config needed. Any other axes are pinned to their default. Pass --json for a machine-readable summary.
Conventions
build,release,split, anddoctortake--jsonfor a machine-readable summary on stdout; human progress always goes to stderr, so piped stdout stays clean.build --jsonincludeslayout.mode(variable|static|none) and anyfrozenglyphs from the engine.- After
build, you can open the generated.glyphssource in Glyphs to browse masters and live-preview — optional review, not required to build. - Configs are validated against
schemas/stv-config.schema.jsonbefore any engine work starts; violations name the offending path. - Exit codes:
0success,1failure,2usage error (bad flag, missing or invalid config),3environment error,130interrupted. - Errors carry a stable
STV_*code and a suggested fix;NO_COLORis respected on both streams. - Advanced checkout QA (
list/run/step/status) is separate from the product path above.
Configuration
Everything font-specific lives in stv.config.json (schema v3): family metadata, axes and named instances, per-style donors and masters, vertical metrics, per-glyph repair strategies, and output paths. See schemas/stv-config.schema.json and the examples/inter/ worked example.
