Web Font Loading and Performance: The Complete Guide
Eliminate FOUT, FOIT, and layout shifts from web fonts. Loading strategies, subsetting, and font-display options explained.
Why Web Fonts Cause Performance Issues
Web fonts are one of the most common causes of poor LCP scores and CLS. When a page loads, the browser discovers fonts only after parsing CSS, creating a waterfall: HTML → CSS → Font request. During this delay, text is either invisible (FOIT — Flash of Invisible Text) or shown in a fallback then swapped (FOUT — Flash of Unstyled Text), causing layout shift. Each font weight is a separate download. A typical setup with regular, italic, bold, and bold italic across two families means 8 files — potentially 200–500KB blocking text rendering.
Font Loading Strategies
For best performance: preload your critical font with link rel="preload" as="font" crossorigin, use font-display: swap to show fallback immediately, and subset to only needed characters. For best visual stability: use font-display: optional (shows fallback if font doesn’t load within 100ms — no swap, no shift) and match fallback metrics closely. For best of both: use a variable font (one file for all weights) with preload and optional display.
Subsetting and Self-Hosting
Subsetting removes the glyphs your pages never use. We measured it on Inter 4.1's static Regular WOFF2 (2,937 glyphs, 111 KB) with fontTools 4.62 pyftsubset (script and results in our test folder, October 13, 2026):
| Subset | Default features | All OpenType features kept |
|---|---|---|
| Full font | 111.3 KB, 2,937 glyphs | |
| Basic Latin only (U+0020–007E) | 10.4 KB, 178 glyphs | 19.1 KB, 484 glyphs |
| Google Fonts' "latin" range | 19.4 KB, 418 glyphs | 30.4 KB, 815 glyphs |
| Latin + Latin Extended (U+0000–024F) | 24.8 KB, 657 glyphs | 36.1 KB, 1,121 glyphs |
A Basic Latin subset is about a tenth of the full file. Two cautions: pyftsubset drops OpenType features it does not keep by default (Inter's stylistic sets, tabular figures and the like), which is why keeping them roughly doubles the size; and an ASCII-only subset breaks names such as "José" or "Zoë" — the browser falls back to another font for those letters. Google Fonts serves several unicode-range files per family, so a page downloads only the ranges its text needs.
Self-hosting removes the connection to a third-party origin, and the old argument for Google's CDN — fonts already cached from other sites — no longer holds: Chrome partitioned its HTTP cache by top-level site in version 86 (2020), as Safari had done earlier, so a font cached on one site is downloaded again on yours. There is also a privacy angle in the EU: in January 2022 the Munich Regional Court (LG München I, 3 O 17493/20) held that a site passing a visitor's IP address to Google by embedding Google Fonts without consent violated the GDPR and awarded €100 damages.
The font-display Property
CSS Fonts Level 4 defines font-display as a timeline with a block period (text invisible), a swap period (fallback shown, real font swapped in when it arrives) and a failure period. The spec suggests short block periods of about 100 ms and gives these profiles:
block: a short block period (the spec suggests 3 seconds) and an infinite swap period. swap: an extremely small block period and an infinite swap period — text appears at once and swaps whenever the font arrives. fallback: an extremely small block period and a short swap period (about 3 seconds); a font that arrives later is not used. optional: an extremely small block period and no swap period; if the font is not ready almost immediately, the fallback stays for that page, and the browser may use the now-cached font on the next page view rather than for the whole visit.
For most sites, swap plus a fallback whose metrics are matched with size-adjust, ascent-override and descent-override keeps both readability and layout stability; optional suits pages where a late swap would hurt more than a system font.
