Tune CSS font metrics for a zero-CLS fallback

Calculate size-adjust and vertical overrides, then test fallback wrapping and cumulative layout shift at production breakpoints.

Open the font workbench

Measure a string with both fonts

If a heading measures 600 px in the primary font and 580 px in the fallback at the same size and weight, the fallback scale is 600 ÷ 580, or 103.44828%. Use text that represents actual traffic, including the longest heading and the narrowest button. Check all weights independently.

Divide each vertical metric by the same scale

CSS applies size-adjust to the overridden metrics too. With a primary ascent of 96%, descent of 24%, and zero line gap, the adjusted descriptors are 92.8%, 23.2%, and 0%. Declare the font face with a distinct fallback name and put it immediately after the primary font in the stack.

Record the swap and inspect changed wrapping

Run a cold load with throttling. Compare the hierarchy before and after the primary face loads at all key breakpoints. Inspect the layout-shift entries in browser performance tooling. Test missing local fonts, long strings, and different scripts, because the calculation matches a measured sample and other glyph advances can differ.

@font-face {
  font-family: "Adjusted Arial";
  src: local("Arial");
  font-weight: 400;
  size-adjust: 103.44828%;
  ascent-override: 92.8%;
  descent-override: 23.2%;
  line-gap-override: 0%;
}
.hero { font-family: "Primary", "Adjusted Arial", sans-serif; }

Font matching tools

Font licensing and replacement guides

Frequently asked questions

Is size-adjust the same as font-size-adjust?

The size-adjust descriptor scales one face in @font-face. The font-size-adjust property adjusts rendered font sizing across the applicable font stack according to a chosen metric.

Will matching the line box eliminate every layout shift?

Matching vertical metrics helps preserve line boxes. Wrapped content can still move when glyph widths differ, and CLS also counts shifts from unrelated elements.