---
title: "Web Font Performance: font-display, Preload and Subsetting"
description: "Keep custom fonts from slowing your site: WOFF2, font-display, preload, subsetting, variable fonts and fallback metrics that prevent layout shift."
url: https://sanderyaz.com/en/blog/web-font-performance/
author: Sander Yazıcıoğlu
date: 2026-12-02
updated: 2026-12-02
lang: en
tags: ["Performance","Frontend","CSS","Core Web Vitals"]
---

# Web Font Performance: font-display, Preload and Subsetting

On this site headings use Exo 2 and code blocks use IBM Plex Mono. Good for brand feel, but every badly loaded font either hides text (FOIT) or makes the page jump when it arrives (CLS). Fonts were one of the things I spent the most time on while moving the Lighthouse score from the 90s to 100.

## 1. Use WOFF2 only

Every modern browser supports WOFF2. Keeping TTF, EOT or WOFF fallbacks in `@font-face` only bloats the CSS.

```css
@font-face {
  font-family: 'Exo 2';
  src: url('/fonts/exo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+011E-011F, U+0130-0131, U+015E-015F;
}
```

## 2. Choosing font-display

| Value | Behaviour | When |
|---|---|---|
| `swap` | Fallback first, then the custom font | Headings and body text |
| `optional` | Skip the font if it doesn't arrive quickly | Where performance beats design |
| `block` | Hides text briefly | Icon fonts (better: don't use them) |

For body text, `optional` is the safest choice for LCP and CLS: first visits get the system font, later visits get the cached custom font.

## 3. Preload the critical font

Preload the one font used above the fold, not all of them:

```html
<link rel="preload" href="/fonts/exo2-latin.woff2" as="font" type="font/woff2" crossorigin />
```

`crossorigin` is required even on the same origin; forget it and the font downloads twice. Preloading four weights steals bandwidth from the LCP image.

## 4. Subset your fonts

A Google Fonts file contains thousands of glyphs. A Turkish and English site needs only Latin plus a slice of Latin Extended. With `pyftsubset`:

```bash
pyftsubset Exo2.ttf --unicodes="U+0000-00FF,U+011E-011F,U+0130-0131,U+015E-015F" \
  --flavor=woff2 --output-file=exo2-latin.woff2
```

If you support a language with extra letters, test them. On Turkish sites the classic bug is ğ, ı and ş rendering in the fallback font.

## 5. Variable fonts

A single variable font (`font-weight: 400 800`) is usually smaller than four separate weight files and arrives in one request.

## 6. Kill CLS with fallback metrics

If line lengths change when the custom font arrives, the page jumps. Make the fallback's metrics match:

```css
@font-face {
  font-family: 'Exo 2 Fallback';
  src: local('Arial');
  size-adjust: 104%;
  ascent-override: 92%;
  descent-override: 24%;
}
body { font-family: 'Exo 2', 'Exo 2 Fallback', system-ui, sans-serif; }
```

Tools such as Next.js `next/font` and Fontaine calculate these values for you.

## 7. Self-host

A third-party font CDN adds DNS, TLS and connection cost, and browsers no longer share caches across sites. Serve fonts from your own domain with hashed file names and long-lived caching.

## Checklist

- WOFF2 only, subset
- Above-the-fold font preloaded, with `crossorigin`
- `font-display: swap` or `optional`
- Fallback metrics tuned
- Self-hosted with an `immutable` cache

For the same ideas applied to images, see [web image optimization](/en/blog/web-image-optimization/); for the bigger picture, the [Core Web Vitals guide](/en/blog/react-core-web-vitals-lcp/).

---

About the author: [Sander Yazıcıoğlu](https://sanderyaz.com/en/about/). Sander Yazıcıoğlu is a Senior Full-Stack Developer in Istanbul. At LiveTesting he builds the backend, frontend, realtime systems and Appium automation of a real-device testing platform; before that he built enterprise Angular apps at Testinium and Loadium.
