Orofold Labs

Launching soon

Notes Get in touch

Performance and accessibility 4 min read Updated

Web fonts without slowing the page or moving the text

In short

Ship one compressed, subsetted file per style you need, and pick a font-display value for each family on purpose.

Web fonts give a site its character, but every font file is a download that can delay text and shift the layout. Decide first whether to self-host. Then set font-display on purpose rather than accept the browser’s default.

Self-hosting does not guarantee a faster site

Self-hosting removes the connection to a third-party font origin, and on paper it should perform better. web.dev is careful about the result, though. A Web Almanac finding noted that sites using third-party fonts sometimes rendered faster than sites using first-party fonts. Self-hosting helps most when you also use a CDN and HTTP/2. If you self-host, apply the optimisations that font providers usually do for you, such as subsetting and WOFF2 compression.

Ship WOFF2 and only the characters you need

WOFF2 has the widest browser support and the best compression among modern formats. It uses Brotli, which the guidance says compresses about 30% better than WOFF. The guidance cites the 2022 Web Almanac in support of using WOFF2 alone.

Subsetting means shipping only the characters you need. The unicode-range descriptor tells the browser which characters a file covers, so the file downloads only when the page contains matching characters. Latin fonts typically have about 100 to 1,000 glyphs, while CJK fonts can exceed 10,000 glyphs, so subsetting matters most for large scripts. Check that the licence allows both subsetting and self-hosting. Google Fonts subsets by default. That step is easy to lose when you move to self-hosted files, which can then become much larger.

Choose font-display on purpose

By default, Chromium and Firefox block text for up to three seconds while a web font loads. Safari blocks text indefinitely, so the browser default is not a plan. The five values behave as follows:

ValueWhat happens while the font loads
autoThe browser decides the strategy
blockA short invisible period, then an unlimited swap period
swapAn extremely small invisible period, then the fallback is replaced whenever the font arrives
fallbackAn extremely small invisible period, then a short period in which the font can still replace the fallback
optionalAn extremely small invisible period and no swap; the web font is used only if it is ready in time

The guidance calls optional the most performance-oriented choice, because it avoids swap-related layout shifts. The price is that a late font is never used. Swap shows text quickly, but a late font causes a visible shift. The values can be combined, for example swap for branding and optional for body text. Icon fonts fit these strategies poorly, so replace them with SVG where possible.

Working on something similar in your own product? A few honest sentences are enough – we read every enquiry and reply by email. Apply with your idea

Preload only the font your first screen needs

Preloading makes a critical font discoverable early, but it takes resources away from other downloads. It also bypasses some of the browser’s normal content negotiation and ignores unicode-range. Use it for the most important font, ideally in a single format. Preloading helps most when the font is referenced from an external stylesheet. Font files must be sent over CORS, which is why the guidance adds the crossorigin attribute to the preconnect hint for a third-party font origin.

A variable font pays off with many styles

A single variable font can replace several files by offering adjustable axes, such as weight. Variable fonts are usually larger than one single-style file, so the benefit is greatest when a site uses many styles and weights. If the page needs only one or two weights, a few static files may be the smaller choice. Measure both before deciding.

A practical checklist

  1. List every font file the page loads, and remove families and weights that no page uses.
  2. Serve WOFF2 files, subset them to the characters you need, and check the licence first.
  3. Set font-display for each family. Use optional for body text, and swap for branding where the look matters most.
  4. Choose a fallback font of similar size, and adjust it with size-adjust so the switch causes little movement.
  5. Preload only the one or two most critical font files, with crossorigin when the font is on another origin.
  6. Load the page on a slow connection and check how the text looks while the font is still loading.

Font swaps are one source of layout shift, see Fixing Cumulative Layout Shift without jumping content. Fonts also load early in the page, so their timing affects the largest element as well, see Fixing Largest Contentful Paint one delay at a time.

Common questions

Is self-hosting always faster?
Not necessarily. Self-hosting should remove a connection to another origin, but a Web Almanac finding noted that sites using third-party fonts sometimes rendered faster. Self-hosting helps most when you also use a CDN and HTTP/2.
Which font-display value should I use?
The guidance calls optional the most performance-oriented choice, because it avoids swap-related layout shifts, but it skips the web font when that arrives late. Swap shows text at once and can cause a visible shift. Combining values is allowed, for example swap for branding and optional for body text.
Why should I use WOFF2?
WOFF2 has the widest browser support and the best compression among the modern formats. It uses Brotli, which the guidance says compresses about 30% better than WOFF.

Sources

  1. Optimize web fonts for Core Web Vitals, web.dev (Google). Accessed 24 November 2026
  2. font-display, MDN Web Docs (Mozilla). Accessed 24 November 2026

Further reading

Have an idea that should exist? Or a working product that needs more customers, a new website or a complete rework? Bring us anything. Apply with your idea

All notes