Font loading strategy minimizes layout shift and blocking
Why it matters
Custom web fonts are a dual CLS and FCP risk: without font-display: swap, the browser hides text entirely until the font loads (FOIT — Flash of Invisible Text), delaying FCP and making the page appear blank. When the font finally loads and text reflows to a different line-height or character width, it produces layout shift that contributes to CLS. Google Fonts loaded via external <link> tags compound this by adding an extra DNS lookup and cross-origin connection before the font file starts downloading. ISO-25010 time-behaviour covers both of these: rendering delay and post-render layout instability. Marketing pages with two or more font families at multiple weights can accumulate 300–600ms of font-related latency on slow connections.
Severity rationale
Medium because font loading strategy affects both FCP (invisible text delay) and CLS (text reflow on font swap), but the impact is bounded to pages using custom web fonts and is fully remediable.
Remediation
Replace Google Fonts <link> tags with next/font — it self-hosts fonts, applies font-display: swap automatically, and generates preload hints so the font starts downloading immediately.
// app/layout.tsx — next/font handles everything
import { Inter, Playfair_Display } from 'next/font/google'
const inter = Inter({
subsets: ['latin'],
display: 'swap',
preload: true,
})
const playfair = Playfair_Display({
subsets: ['latin'],
weight: ['400', '700'], // only load weights you actually use
display: 'swap',
})
export default function RootLayout({ children }) {
return <html className={`${inter.className}`}>{children}</html>
}
For manual setups without next/font, add font-display: swap to every @font-face in src/styles/globals.css and a <link rel="preload" as="font" crossorigin> for the primary font file in the <head>.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Page Speed Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · performance-efficiency.time-behaviour — Font-display strategy — minimises FOIT/FOUT delay
Taxons
History
- 2026-04-18·v1.0.0·Initial import from marketing-page-speed·automated