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.

drop .woff2 / .woff / .ttf / .otf · interactive Ghost Overlay canvas

.woff2 · .woff · .ttf · .otf

  • OS/2 USE_TYPO_METRICS math
  • Latin & CJK width presets
  • Live Ghost Overlay toggle
100% browser-localVerify 0 bytes sent in Network tab

Benchmark & Expected Output

size-adjust: 106.4% · 0.00 CLS

Before (Input)

TTF / WOFF2 · inter-regular.ttf (112 KB)

After (Output)

CLS Override CSS · size-adjust, ascent-override, descent-override & line-gap-override

Source vs. target font specification comparison
PropertySource: WOFF2Target: CSS @font-face
File extension.woff2.css
CompressionBrotli (entropy + table transform)Text / optional gzip
Outline / CurveQuadratic or Cubic SFNTCSS / Data URI Text
Browser supportAll Modern Browsers (97%+)Universal (Web + OS)
OpenType GSUB/GPOSYesYes
Best forProduction 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.

  1. Drop your webfont

    Load any WOFF2, TTF, or OTF file; FontTo inspects OS/2 and hhea tables locally.

  2. Toggle Ghost Overlay

    Compare unaligned Arial/PingFang fallback (CLS) vs metric-aligned fallback (0.00 CLS) live.

  3. 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.