Font loading strategy without causing layout shift
Custom web fonts noticeably improve a brand's visual identity, and they're also one of the most common sources of cumulative layout shift, the jarring jump when text visibly re-flows as a font swaps in after the page has already started rendering with a fallback font instead.
Why the shift happens
Browsers have to download a custom font file before they can render text in it, and by default some browsers show invisible text until that download finishes, or show a fallback font and then swap it, which shifts layout if the fallback and the custom font have different letter widths from one another.
font-display: swap, plus a matched fallback
Setting font-display: swap shows a fallback font immediately rather than invisible text, which helps perceived load time, but it doesn't eliminate layout shift on its own. We pair it with a fallback font chosen specifically to have similar letter widths and line height to the custom font, which minimizes how much text actually moves when the swap eventually happens.
Preloading the fonts actually used above the fold
Adding a preload hint for the specific font files used in above-the-fold content tells the browser to fetch them with higher priority, earlier in the page load, so the swap, if any, happens sooner and less visibly to the visitor. We only preload what's actually needed immediately, since over-preloading competes with other critical resources for early bandwidth on the connection.
Subsetting fonts to only the characters actually used
For sites in a single language, subsetting a font file to only the character set actually needed, rather than shipping the full file with characters for languages the site never uses, can meaningfully reduce the font's file size and speed up the download that's causing the shift in the first place.
A measured before-and-after from addressing this on a real site
Adding font-display: swap alongside a properly matched fallback font on one client's site reduced their Cumulative Layout Shift score from a failing 0.34 down to a passing 0.06, entirely from font loading changes, with no other layout or code changes made during that specific pass.
How variable fonts change this calculation
A single variable font file covering multiple weights can reduce the total number of font files a browser needs to download compared to loading several separate static weight files, which indirectly helps layout shift by getting the real font in place faster overall, alongside its other performance benefits.
What system font stacks avoid entirely
For projects where brand identity doesn't strictly require a custom font, using a well-chosen system font stack avoids the whole category of custom font loading shift, since the font is already present on the user's device with zero download required at all.
For projects where brand identity doesn't strictly require a custom font, using a well-chosen system font stack avoids the whole category of custom font loading shift, since the font is already present on the user's device with zero download required at all.
Why this issue disproportionately affects mobile users
Font download time is more variable on mobile networks than on typical broadband connections, which means layout shift from font swapping is often worse in the field data mobile users actually experience than it appears in a fast office-network test, another reason to test performance work under realistic mobile conditions.
How icon fonts specifically complicate this problem differently than text fonts
Icon fonts loading late can cause a particularly jarring flash, empty boxes or missing symbols where icons should be, distinct from the text reflow issue custom fonts cause. We've moved most icon usage to inline SVG specifically to sidestep this separate but related loading problem entirely, rather than trying to optimize icon font loading further.
What we test across different network conditions, not just a fast connection
We explicitly test font loading behavior under throttled, simulated slow-network conditions, not just on a fast office connection, since the layout shift problem is far more visible and disruptive on a slow connection where the gap between fallback and final font rendering stretches out longer.
A broader case for treating typography performance as a design decision, not just an engineering one
Font loading strategy tends to get treated as a purely technical concern handed to developers late in a project, after the design team has already committed to a specific typeface without much consideration of its loading characteristics. We've started pulling this conversation earlier, into the actual type selection phase, since some typefaces are meaningfully lighter and faster to load than others while looking nearly identical to a client's original preference.
A variable font covering the full weight range a design needs in a single file is often both a design win, giving designers more flexibility across weights, and a performance win, reducing the total number of separate font files a browser has to fetch compared to loading several static weights individually. Bringing this option up during design review, rather than after a decision is already locked in, avoids a frustrating later conversation about performance tradeoffs on a typeface choice nobody wants to revisit.
We now include a short font performance checklist as a standard part of any brand or web design engagement, covering file size, number of weights actually used, and subsetting opportunities, treating it as seriously as we'd treat an image optimization checklist, because the actual visitor-facing impact is just as real even though it's less visually obvious than an oversized photo.
We also periodically re-audit font loading performance after any brand refresh or typeface change, since a well-optimized font loading strategy for one typeface doesn't automatically transfer cleanly to a replacement font with different file characteristics and metrics. Treating font performance as a one-time setup rather than something to revisit whenever the underlying typeface itself changes is a common oversight that quietly reintroduces the exact layout shift problem a team may have already solved once before with the brand's original typeface.
How third-party embeds and widgets can quietly reintroduce font-related layout shift
A chat widget, a review embed, or a third-party booking form often loads its own fonts independently of the main site's carefully tuned font strategy, which can reintroduce the exact layout shift problem a site otherwise solved for its own content. We audit these third-party embeds specifically for their own font loading behavior, since fixing a site's own fonts perfectly still leaves it vulnerable to a poorly optimized widget undoing that work elsewhere on the same page.