Eliminate Web Font Layout Shift (Anti-CLS)
Compute exact CSS size-adjust, ascent-override, descent-override, and line-gap-override metrics from your font's OS/2 and hhea tables — and preview alignment live with our interactive Ghost Overlay.
.woff2 · .woff · .ttf · .otf
- OS/2 USE_TYPO_METRICS math
- Latin & CJK width presets
- Live Ghost Overlay toggle
Benchmark & Expected Output
size-adjust: 106.4% · 0.00 CLSBefore (Input)
TTF / WOFF2 · inter-regular.ttf (112 KB)
After (Output)
CLS Override CSS · size-adjust, ascent-override, descent-override & line-gap-override
| Property | Source: WOFF2 | Target: CSS @font-face |
|---|---|---|
| File extension | .woff2 | .css |
| Compression | Brotli (entropy + table transform) | Text / optional gzip |
| Outline / Curve | Quadratic or Cubic SFNT | CSS / Data URI Text |
| Browser support | All Modern Browsers (97%+) | Universal (Web + OS) |
| OpenType GSUB/GPOS | Yes | Yes |
| Best for | Production web typography across all modern browsers, delivering 40%–60% smaller payloads than TTF/OTF and ~30% smaller files than WOFF 1.0. | Loading self-hosted WOFF2 fonts with font-display: swap, unicode-range lazy slices, and zero-CLS size-adjust fallbacks. |
How it works
How to use Font CLS Fix Generator locally in your browser
Compute exact size-adjust, ascent-override & descent-override CSS with an interactive Anti-CLS Ghost Overlay.
Drop your webfont
Load any WOFF2, TTF, or OTF file; FontTo inspects OS/2 and hhea tables locally.
Toggle Ghost Overlay
Compare unaligned Arial/PingFang fallback (CLS) vs metric-aligned fallback (0.00 CLS) live.
Copy Anti-CLS CSS
Paste the fallback @font-face alongside your primary font-family stack.
FAQ
Frequently asked questions
How does FontTo calculate size-adjust more accurately than simple tools?
It checks OS/2.fsSelection USE_TYPO_METRICS (0x0080) vs hhea vertical metrics and weights horizontal advance widths for Latin vs 1.0 em CJK scripts.
Which system fallback presets are included?
Includes Arial (Sans), Times New Roman (Serif), PingFang SC / Microsoft YaHei (CJK Sans), and system-ui.
Does this fix Core Web Vitals CLS caused by font swaps?
Yes — aligning fallback metrics prevents horizontal reflow and vertical line-height jumps when WOFF2 loads.
Format specs
Next step