Web font loading for newcomers

One newcomer asked last month how much we worry about web font loading in the first place. Our answer took more than one chat message, so here it is.

What it is

Custom fonts are files the browser downloads before it can draw text in them; the way that loading is set up—preloading, fewer characters, font-display—sets if readers see invisible text, a jumping text or neither.

How it works

Serving font files on your own server spares the browser a second connection plus a lookup. The swap value of font-display shows the copy straight away in a local font, then swaps when the downloaded font arrives.

@font-face {
  font-family: "Copy";
  src: url("/fonts/copy-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-display: optional;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153;
}

body { font-family: "Copy", Georgia, sans-serif; }

In practice

Fetching early the font an opening screen uses speeds up the first paint, while preloading every weight elbows images aside.