Web font loading: how fonts hurt LCP and CLS
Custom fonts can delay your largest text and shift your layout. Here is how font-display, preloading, and fallback tuning fix both.
Fonts are easy to forget when you tune a page. They are small files, and they look harmless. But a custom font sits right in the path of two Core Web Vitals. It can delay the largest text on the page, and it can make that text jump when it finally loads. Both show up in field data, and both are fixable in an afternoon.
How fonts affect LCP and CLS
On many pages the largest element is a headline or a block of text. If that text uses a web font, the browser has to discover the font file, download it, and only then draw the text the way you intended. The font request usually starts late, because the browser finds it only after it has parsed the CSS and built the render tree. That delay lands directly on LCP.
CLS comes from the swap. The browser first shows a fallback font, then replaces it with your custom font. If the two fonts have different widths or line heights, the text reflows and everything below it moves. A few pixels of movement is enough to add up on a long headline.
Pick the right font-display value
The font-display descriptor in your @font-face rule controls what the browser shows while the font loads. The choice is a trade-off between invisible text, text that swaps, and text that never changes.
- block: hides text for a short period, then swaps. Bad for LCP because the text may not paint at all at first.
- swap: shows the fallback immediately and swaps when the font arrives. Good for LCP, but it can cause a layout shift.
- fallback: a very short hidden period, then a fallback, with a limited window to swap. A reasonable middle ground.
- optional: uses the font only if it is ready almost at once. Otherwise the fallback stays for that page view. No swap means no shift, but some visitors never see your font.
For body text, swap or fallback is a safe default. If your brand font matters less than stable layout, optional is the strongest choice for CLS. Test it on a slow connection before you commit, because it changes what real visitors see.
Get the font file there sooner
Most gains come from starting the download earlier and shipping fewer bytes. These steps are low risk.
- Self-host your fonts. A third-party font host adds a DNS lookup and a connection before the first byte. Browsers also partition their caches by site now, so the old benefit of a shared cached copy from another site is gone.
- Use WOFF2. It is supported by all current browsers and compresses much better than older formats.
- Preload the one or two fonts used above the fold. Add a preload link with as set to font, type set to font/woff2, and the crossorigin attribute. Without crossorigin the browser fetches the font twice.
- Subset the files. If you only need Latin characters, do not ship Cyrillic and Greek glyphs. Smaller files finish sooner.
- Cut the number of weights and styles. Every extra file is another request. A variable font can replace several static files with one.
Do not preload every font. Preloading competes with other critical resources, such as your hero image and main CSS. Preload only what the first screen needs.
Tune the fallback to stop the shift
Even with fast loading, a swap can still move text if the fallback is a different size. CSS has descriptors for this. In the @font-face rule for a local fallback, size-adjust scales the glyphs, and ascent-override, descent-override, and line-gap-override match the vertical metrics. When they line up with your web font, the swap becomes almost invisible.
You do not have to calculate these by hand. Some frameworks generate adjusted fallback fonts for you at build time, and there are free tools that output the values for a given font pair. Check that your framework does it before you add the CSS yourself. Browser support for these descriptors is good in current Chromium and Firefox, but check your own audience before you rely on them.
Measure it properly
Lab tools will show the font request in a waterfall. They will not tell you what real visitors experience. Use field data to confirm a change helped. The Chrome User Experience Report and your own real-user monitoring are the right sources, and Search Console's Core Web Vitals report groups URLs by the same data.
Expect small, honest gains. Fonts are rarely the whole story behind a poor LCP, and Core Web Vitals are one signal among many. A fast font setup will not rescue thin content. It will remove one easy source of delay and one easy source of layout shift.
What to do this week
Open your slowest template and check three things. Is the above-the-fold font self-hosted, in WOFF2, and preloaded with crossorigin? Does the @font-face rule set a deliberate font-display value? Does the fallback match the web font's metrics? Fix whichever of the three fails first, then compare field LCP and CLS after a few weeks of data.