warp: point-compatible masters and a two-master variable font spike

Merged
RI
2d ago
+3096-14

What

Feasibility test for a variable wght axis in Warp, behind a flag. The default build and the committed fonts do not change.

  • warp/tools/compat.py compares the Regular and Bold outlines of the 890 glyphs of the 0.2 set and writes proofs/warp/compat.json (one row per glyph, with the reason when a glyph is incompatible).
  • warp/loom/compatible.py is a compatible outline path: both masters are sampled at fixed fractions between corners. 15 glyphs also needed a topology policy (separate overlapping strokes, a split loop stroke, or corrected components).
  • warp/tools/vf_spike.py builds the variable TTF from the two masters and compares its instances at 400 and 700 with the static outlines.

Proof

compat.py (default):  glyphs 890, contours-compatible 851, point-compatible 28
compat.py --fixed:    glyphs 890, contours-compatible 890, point-compatible 890
vf_spike.py:          instance 400: max difference 0.020 units, instance 700: max difference 0.520 units
pytest -k "compat or deterministic or cpu":   16 passed (the hard-glyph test is unchanged)
fidelity maximum (compatible path):           3.048 % Regular, 2.327 % Bold (limit 5 %)
Fontspector 1.9.0, universal, spike font:     PASS 95, WARN 775, FAIL 0, ERROR 0
875 already compatible glyphs:                zero changed points
default path:                                 18 of 18 files byte-identical to fonts/warp

Notes

Verdict for the two-master test: verified. Not verified: five weights, italics, opsz. Fontspector reports 770 interpolation warnings on the spike font; they stay open before any production variable font. Visual proofs of the 15 glyphs show no overlap gaps or darker overlaps. No font file is committed.

Summary by CodeRabbit

  • New Features
    • Added an optional compatible-outline build mode for Regular and Bold. Default font builds remain unchanged.
    • Added tools to compare outlines and assess two-master variable-font compatibility and visual fidelity, with sampling and refitting options.
  • Documentation
    • Documented matching point structure across 890 glyphs in the Regular/Bold test. Endpoint checks pass, but interpolation warnings remain; lighter weights, italics, and other optical sizes are not covered.
    • Updated project status and roadmap, including the open full weight ladder and optical-size work.