Creative workflow

Match a Fallback Font’s X-Height With CSS font-size-adjust

Two unequal charcoal stones meet the edge of folded ivory paper

The fictional Sable Market hours label looked smaller during fallback even though its CSS font-size stayed at 32px. We measured the size of a 1ex probe in Chromium and assembled the two views on the production canvas.

Quick answer

Measure the lowercase x-height of the intended font relative to its font size. Set that ratio in font-size-adjust, force the fallback, and check the lowercase letters and resulting line breaks.

Test the same copy and measure the lowercase height

Choose a short label with lowercase letters, such as 'Open all afternoon'. Keep text, box width and nominal size fixed. Add a test element one ex wide and read its rendered width. Browser and font choices can change the exact number.

Production canvas at the start

The Ciyo comparison board shows a natural fallback with a measured x-height of 14.31 CSS pixels
Production canvas at the start

Set a target ratio for the fallback

Use font-size-adjust: 0.52 on the label in the example. At a nominal 32px, 0.52 corresponds to about 16.64px. Chromium measured the natural fallback at 14.31px and the adjusted version at 16.63px. Use the target ratio from your real preferred font rather than adopting the example value blindly.

Review line breaks and ascenders independently

The fallback’s glyph shapes and widths still differ. Check the long label, wrapping and clipping at narrow widths, then test with the preferred font loaded and with it deliberately unavailable. Use appropriate script metrics for the actual languages on the page.

Production canvas after the comparison

The paired Ciyo view reads 14.31 and 16.63 CSS pixels for the natural and adjusted fallback
Production canvas after the comparison

Keep a readable reference for visual review

Capture both browser states at the same width, put the natural fallback on the Ciyo board, then position the adjusted result alongside it. Keep the probe measurements in the review notes so a visual difference can be reproduced.

Example files

Sources and related reading

Quick questions

Will font-size-adjust remove every layout shift?

It can bring lowercase size closer. Different glyph widths, line heights and wrapping can still move content.

Why measure 1ex?

It gives a repeatable readout tied to the active font’s x-height in this browser. Check the rendered text as well as the probe.

Try it on your canvas

Keep the input and reviewed result on separate layers so you can revisit the decision before handing off the final file.