An @font-face rule on the page has no font-display descriptor, so the browser uses its default and can hide text for up to about three seconds while the web font downloads. font-display: swap shows the text in a fallback font immediately and swaps in the web font when it arrives.
When a page uses a web font, the browser has to decide what to show before the font file arrives. The font-display descriptor in @font-face controls that decision. It divides the font's loading time into a block period, when text using the font is invisible, and a swap period, when text is shown in a fallback font and replaced once the web font loads.
Without font-display, the browser uses auto, which in current browsers behaves like block. The result is a flash of invisible text (FOIT): headings and body copy stay blank until the font downloads or a timeout of about three seconds passes.
| Value | Block period | Swap period | Use it for |
|---|---|---|---|
auto | Browser default (usually like block) | Browser default | Nothing; set a value explicitly |
block | Short (about 3s) | Infinite | Icon fonts, where fallback glyphs would be wrong |
swap | Extremely short (about 100ms or less) | Infinite | Brand and heading fonts that must eventually appear |
fallback | Extremely short (about 100ms) | Short (about 3s) | Body text: use the web font only if it arrives soon |
optional | Extremely short (about 100ms) | None | Body text where layout stability matters most |
The timings are the values the CSS Fonts specification recommends; browsers may differ slightly.
bseoa reads the page's inline <style> blocks and reports this warning when an @font-face rule doesn't include font-display. Rules in external stylesheets need the same fix.
@font-face {
font-family: 'Brand Sans';
src: url('/fonts/brand-sans.woff2') format('woff2');
}
Add font-display to every @font-face rule:
@font-face {
font-family: 'Brand Sans';
src: url('/fonts/brand-sans.woff2') format('woff2');
font-display: swap;
}
For Google Fonts, add the display parameter to the stylesheet URL. Google then writes the descriptor into every @font-face rule it serves:
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap">
If you self-host fonts loaded by a framework (Next.js next/font, Fontsource, a theme), check its font-display option. Many default to swap, but not all.
Often, yes. Largest Contentful Paint measures when the largest element in the viewport is rendered, and on text-heavy pages that element is frequently a heading or paragraph. Text hidden during the block period isn't painted, so a slow font delays LCP. With swap, the fallback text paints almost immediately, and that paint counts.
The trade-off is layout shift. When the web font replaces the fallback, differences in character width and line height can move content and add to Cumulative Layout Shift. Two ways to reduce it:
<link rel="preload" href="/fonts/brand-sans.woff2" as="font" type="font/woff2" crossorigin>.size-adjust, ascent-override and descent-override descriptors, so the swap barely moves anything.@font-face {
font-family: 'Brand Sans Fallback';
src: local('Arial');
size-adjust: 104%;
ascent-override: 92%;
}
body {
font-family: 'Brand Sans', 'Brand Sans Fallback', sans-serif;
}
The right percentages depend on the two fonts. Tools such as Fontaine and next/font calculate them automatically.
Use swap for most web fonts. Use optional for body text when you'd rather keep the fallback than risk a visible shift on slow connections. Keep block for icon fonts only. Serving the fonts as WOFF2 and preloading the critical ones makes every option behave better; see font not in WOFF2 format and LCP text missing font-display.
This issue can affect your site's search engine rankings and user experience. Addressing it promptly helps ensure optimal performance and visibility in search results.
bseoa automatically checks for this warning during site analysis, along with hundreds of other technical SEO issues.
Choose the license that fits your needs and start getting the deep, actionable insights you deserve.