The page appears, someone starts reading, and a second later the heading wraps onto an extra line and pushes the button down. The cause may be the fallback font being replaced by the primary font. But similar behavior can also be caused by a late-loading banner, an image without dimensions, or an inserted widget, so first confirm the specific connection.
To check the cause, compare the font loading time with text wrapping and the button's movement. Consider a service page with a large heading. Choose fallback font adjustments based on measurements from this page: values may differ for another font or language.
Reproduce the first visit without the cache
Check a narrow screen where the heading is close to a wrap point. A small difference in letter widths can add a whole line and move everything below it. On a wide screen, the same font may change only the spacing, so seeing no shift at one viewport size does not rule out the problem.
Don't substitute an artificial scenario in which all styles are disabled. Reproduce the page's actual loading behavior, then test the hypothesis separately. A before-and-after screenshot is useful for explaining the issue, but doesn't identify the cause on its own; determine that from the sequence of events.
Compare the shift with the font loading time
Check for other changes at the same time. If a consent form appeared or a banner loaded at the same time, the connection to the font has not yet been proven. To compare, block only the font file in your DevTools Network request blocking settings and reload the page. If the shift disappears, continue investigating font replacement. Then remove the block; this test does not change the live site settings.
The CLS guide describes causes of instability and measurement considerations. For this task, include your own trace: the general advice to “optimize fonts” doesn't explain why this particular heading changed its number of lines.
Check which font weights are used
Check bold text separately. The font for regular text and the file for headings may load at different times. Browser-synthesized weights or an incorrect mapping of the file to font-weight add another difference. Record the weight actually used, not just the family name in the CSS.
Compare line heights, the widths of representative phrases, and the number of line breaks. In the heading “Ventilation installation for offices,” what matters is not a single character but the block's total height. The same check on a short button will reveal changes to its width and the position of neighboring elements.
In Chrome, open Network, select the Font filter, and reload the page with Disable cache enabled. Then select the heading in Elements → Computed → Rendered Fonts. Compare the page before and after loading: family, weight, number of lines, and button position. If a banner appeared along with the font, find the source of the shift in the Performance recording.
Check font-display
Descriptions of the available options are in the MDN documentation on font-display. Compare suitable options on a test copy: swap displays the fallback font quickly but allows a late swap; optional may keep the fallback font if the primary font doesn't load in time. Check whether this result is acceptable for your design. No swap in a single run may mean the fallback font was used, not that the primary font loaded faster.
Don't preload every file in the family indiscriminately. The first screen may need one weight, while others are used farther down the page or on other pages. Excessive high-priority requests compete with other important resources. Check which files are actually involved in the initial rendering.
Adjust the fallback font metrics
Check several text samples: a long heading, a short button, a paragraph, and a line with numbers. An adjustment that matches one phrase may make another worse. The MDN reference on size-adjust describes the purpose of the descriptor; choosing the final value requires testing your characters and weights.
Preserve readability. Reducing a line to the desired height isn't a success if the letters become cramped or are clipped. Don't hide the problem with a fixed heading height without testing long text: this can hide part of a sentence on a phone or at increased zoom.
Check long text and zoom
| Scenario | What to observe |
|---|---|
| First visit with a cold cache | Text readability and when a swap may occur |
| Narrow screen | Number of heading lines and button position |
| Increased zoom | No clipping or overlap |
| Font file unavailable | A usable fallback without loss of content |
| Long service name | Layout stability beyond a short example |
Check the menu, form fields, and prices: changes to font metrics affect more than the main heading. Don't set a fixed width on every button just to keep one label on a single line if that breaks translations or longer labels. Button labels should remain readable, and fields should not overlap neighboring text.
Also check returning to the page and reopening it with the cache. These scenarios show whether the new strategy has made normal navigation worse. Differences between a cold and repeat load are acceptable, but the interface should remain readable and usable in both states.
Check a long heading without clipping
A second Performance recording no longer shows the previous shift caused by font replacement. A long service name, Cyrillic text, and the button remain readable on a narrow screen and at increased zoom. If the font file is unavailable, the fallback font preserves the content.
Read also: How to fix layout shifts, Core Web Vitals, Technical audit.