Web typography
Measure fallback-font layout shift
Test whether a late-loading webfont changes line breaks or pushes interface elements, using real content and a repeatable cold-load experiment.
1. Build a real test frame
Use the same fixed-width card and text in two states: the actual fallback stack and the chosen webfont. Keep the font size, line height and padding constant so the change is attributable to the font.
2. Observe cold loading
In browser developer tools disable cache and throttle the network. Reload and capture the fallback state before the font finishes. Observe whether text wraps, buttons move or content becomes hidden.
3. Compare metrics carefully
Read the font's recorded ascent, descent and advance samples, then measure actual browser boxes. CSS size-adjust and metric overrides can reduce differences, but their values must be derived from the selected fallback and target, not copied from an unrelated family.
4. Retest the important widths
Check a narrow phone viewport, a desktop card and zoomed text. Keep the fallback readable and avoid hiding the text while waiting for the font; repeat the cold-load observation after each adjustment.
A 240px card with two states
Use “New arrivals: 24 items” in a 240px card. Capture both fallback and chosen-font states at 16px, then record the number of lines and the vertical position of the next button. A one-line to two-line change is actionable even if the standalone alphabet looks similar.
Common pitfall
The metric table is not a browser layout result. Do not claim a zero layout-shift score without observing real page loads and their timing.
Continue learning
Typography reference with visual examples →