‹ Blog
Performance

Font Loading and the Layout Shift It Causes

November 8, 2026 · 2 min read

Custom web fonts have a timing problem baked into how browsers historically handled them: the browser doesn't necessarily wait for a font file to download before rendering text, and it doesn't necessarily know, in advance, the exact size the eventual custom font's characters will take up compared to whatever fallback font it renders first. That mismatch is one of the most common, and most fixable, causes of layout shift on real websites.

The two default behaviors, and why both cause problems

Historically, browsers picked one of two default strategies when a custom font wasn't ready yet: block rendering entirely until the font loads (a "flash of invisible text" — nothing renders, then everything appears at once, which delays visible content for no necessary reason), or swap — render immediately with a fallback font, then swap to the custom font once it's ready (a "flash of unstyled text," visible immediately but followed by a jarring re-render once the swap happens).

The swap behavior is usually the better user experience — content is visible immediately — but it's also the direct cause of layout shift whenever the fallback font and the custom font take up meaningfully different amounts of horizontal space for the same text. Headlines are the most visible case: a fallback font rendering a headline at one width, then a custom font swapping in and rendering the same text narrower or wider, shifts everything below it on the page.

The fix that actually addresses the cause

Choose a fallback font with similar metrics to the custom font, rather than an arbitrary system default — matching average character width and x-height minimizes how much text reflows when the swap happens. Some font pairings shift barely at all; others (a very condensed custom font paired with a wide system fallback) shift dramatically, and the difference is almost entirely about how well-matched the two fonts' proportions are, not about font-loading strategy at all.

Preload the font file for text that appears early and prominently (a hero headline — often the same element that decides your LCP) with a <link rel="preload"> hint, so the browser starts fetching it as early as possible in the page load rather than discovering it needs to only once it parses the CSS that references it — this narrows the window during which a swap can even happen.

Use font-display: optional for genuinely non-critical text, which tells the browser to use the fallback and simply not bother swapping to the custom font at all if it doesn't arrive within a very short window — trading a small amount of typographic consistency on a slow connection for zero layout shift, a reasonable tradeoff for body text where the visual difference between two well-matched fonts is minor.

None of these fixes require abandoning custom fonts — they just require treating the loading sequence as something to actually design, rather than accepting whatever a browser's unconfigured default produces. MarketMan's performance audit reports the CLS a font swap is contributing so you know whether it's worth chasing.

See what MarketMan finds on your own site.

Enter your URL and get your first SEO, accessibility, and performance scan free.