How to generate coverage reports for every font in your design system
- Step 1Walk fonts directory — fs.readdir(input). For each font, parse with opentype.js, walk every glyph's unicode value into a Set, score against UNICODE_SUBSETS.
- Step 2Emit per-font JSON — Per-font: { filename, totalGlyphs, totalCoveredCodepoints, perBlockCoverage: { 'Latin Basic': 100, 'Cyrillic': 0, ... } }. Write to dist/audit/<font>.coverage.json.
- Step 3CI compare step — Diff against committed baseline. Drops in critical-locale coverage block deploys; drops in irrelevant blocks (e.g., Devanagari for a Latin-only site) emit warnings only.
Frequently asked questions
What baseline should I commit?+
First-deploy baseline: snapshot every font's coverage at adoption time. Compare future builds against this baseline. Updates that intentionally drop coverage (subsetting) require explicit baseline updates.
Is the analysis fast?+
Yes — sub-second per font even for huge CJK fonts. The bottleneck is reading the bytes from disk; coverage calculation is trivial.
Can I limit to specific blocks?+
Yes — modify the UNICODE_SUBSETS the script scores against. For Latin-only sites, score only Latin/Latin-1/Latin Extended. Faster output and clearer signal.
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.