font-display and the Flash of Unstyled Text

Speed & Performance2 min readBy the Monopage team

Web fonts give your site its personality, but they are separate files the browser has to download. While it waits, it must decide what to do with the text. The choices have a real effect on how fast and how stable your page feels.

Two kinds of flash

  • Flash of invisible text (FOIT): the browser hides the text until the font arrives. Visitors see blank spaces, which feels slow.
  • Flash of unstyled text (FOUT): the browser shows text in a fallback font first, then swaps to the web font. Text is readable immediately, but it may change size and shift the layout.

Neither is perfect, but showing readable text sooner is usually better for visitors.

The font-display property

In your @font-face rule, font-display tells the browser how to behave while the font loads. The main values are:

  • auto: the browser decides, often like block
  • block: hides text briefly, then swaps when the font arrives
  • swap: shows fallback text immediately and swaps when ready
  • fallback: a very short invisible period, then fallback text, and a limited window to swap
  • optional: a very short invisible period, and the browser may choose not to use the font at all if it is slow

For most sites, swap is a reliable choice for body text, and optional can be good where avoiding layout shift matters more than showing the exact font on first visit. Test what suits your design.

Reduce layout shift from swapping

When the web font replaces the fallback, differing letter widths and heights can move lines of text. To limit this:

  1. Choose a similar fallback font. Pick a system font with similar proportions.
  2. Use font metric overrides. CSS descriptors such as size-adjust, ascent-override, and descent-override let you tune the fallback to match your web font more closely. Support varies, so check it.
  3. Keep fewer font files. Fewer weights and styles mean fewer shifts. See choosing web fonts without slowing your site.

See how to fix Cumulative Layout Shift.

Make fonts load sooner

  • Self-host fonts where licensing allows, to avoid extra connections and to keep control over caching
  • Use modern formats, such as WOFF2, which are compressed
  • Subset fonts to the characters you need
  • Preload the key font used for the largest text above the fold. See preload, preconnect, and prefetch explained
  • Cache fonts well. See browser caching explained

Consider system fonts

A system font stack loads instantly and looks familiar on each device. It is a legitimate design choice, particularly for fast, simple sites. See best fonts for websites.

Test it

Throttle your network in developer tools and reload. Watch what the text does as fonts arrive. Check for jumps and blank text.

Common mistakes

  • Loading many weights you do not use
  • Hiding text until fonts load
  • A fallback font that looks very different
  • Third-party font hosts with extra delay

Many slow sites run on page builders. Read how to speed up a page builder site.