How to strip font hinting automatically in ci/cd
- Step 1Walk fonts directory — fs.readdir(input). For each TTF, run the binary table-removal helper that strips fpgm, prep, cvt, gasp, hdmx, VDMX, LTSH. Output to dist/.
- Step 2Check output validity — Optional: run the output through opentype.js parser to confirm it still parses correctly. Catches edge cases where the input had non-standard table layouts.
- Step 3Compose with WOFF2 — Pipeline: TTF → unhinted TTF → WOFF2. Run all three steps in sequence; final output ships in /public/fonts/.
Frequently asked questions
Does the script work on OTF (CFF) fonts?+
OTF fonts don't have TrueType hinting tables (fpgm/prep/cvt are TTF-specific). The script is a no-op on OTF inputs — they pass through unchanged. Useful side effect: same script works for both TTF and OTF without branching.
Can I selectively keep some hinting?+
Yes — adjust the table list. Removing only fpgm + prep keeps cvt (control values) which some old renderers still use. Most teams remove all six hinting tables; cherry-picking is rare.
What about CI cache?+
Cache dist/ keyed by input directory hash. Re-runs without font changes hit the cache and skip the strip step entirely. Typical CI overhead: under 1 second when cached.
Privacy first
Every JAD Font tool runs entirely in your browser using opentype.js and the wawoff2 WASM Brotli encoder. Your fonts never leave your device — verified by zero outbound network requests during processing.