
Optimizing web fonts
9/26/2023
This post details techniques for optimizing web font loading and rendering to prevent layout shifts and reduce download times. It explains the use of `font-display` CSS properties (`block`, `swap`, `fallback`, `optional`, `auto`), the `size-adjust` font-face descriptor for matching fallback and web font metrics, and resource hints (`preconnect`, `preload`). It also highlights how the `next/font` module in Next.js automates these optimizations by downloading fonts at build time, serving them locally, and preloading them.

