mirror of
https://github.com/hanzoai/font.git
synced 2026-11-02 23:42:52 +00:00
A variable font is what a browser wants and what a font menu, a design tool and a terminal often cannot use — so Zen shipped as one file people could not always install. zen::instance walks the outlines at a place on the axes, writes them into a plain glyf, and returns a font that needs no variation settings to look right. Same source native and wasm, so the crate the CLI uses is the crate the page runs. Width and tracking are baked rather than left to CSS. transform:scaleX stretches what is painted and leaves the layout box where it was; a font that is really wider carries the width in its advances too, or its letters overlap. Tracking is space a layout engine adds, and here it is space the glyph owns. A cut taken at .zen-wide is therefore that preset, with no stylesheet. Stylistic sets are applied by DRAWING the alternate: a glyph the feature substitutes is written with the substitute's outline and advance under the original's id, so the character map never moves and the file stays a drop-in replacement carrying the letterforms you chose. Only single substitution — a ligature depends on what is beside it and cannot be baked into a glyph. The axis is named rather than assumed, so the pixel element cuts the same way the weight does. Tests measure the cut against the variable font it came from: same points at four weights, same advances, no variation tables, ss01 reaches the a and no other letter, width and tracking land where they should, and the element behaves like any other axis. skrifa 0.22 and write-fonts 0.28 do not build on current rustc; both move up. @hanzo/font 1.8.10 carries the wasm at ./wasm.