Preloading Fonts with font-display Coordination
You'll learn how to combine font preloading with the right font-display strategy to minimize layout shift on a user's first visit.
The Core Idea
When you preload a font, you're telling the browser to fetch it early—but that doesn't automatically control how the font renders while loading. That's where font-display comes in. By coordinating these two techniques, you ensure fonts load quickly and render predictably, avoiding jarring layout shifts on first visits.
Think of it like ordering food for delivery: preloading is calling ahead so your meal starts cooking early, while font-display is choosing whether you'll wait for that specific meal (block), eat a snack immediately and swap when it arrives (swap), or just eat what's already in your fridge if delivery takes too long (optional).
The Coordination Strategy
For critical fonts (like your main heading font):
<link rel="preload" href="heading-font.woff2" as="font" type="font/woff2" crossorigin>
Pair with font-display: optional or fallback in your @font-face. This ensures the preloaded font arrives before first paint, so it either shows immediately or the fallback stays (no swap = no shift).
For body text fonts:
Use preload with font-display: swap. The preload makes the custom font arrive faster, and swap ensures text is readable immediately.
Why This Matters
Without coordination, preloading alone doesn't prevent FOUT (flash of unstyled text) or layout shifts—it just makes the font available sooner. The font-display value controls what the user sees during that loading window. Together, they give you both speed and control.
Key Takeaway: Preloading fonts accelerates delivery, but pairing it with the right font-display strategy ensures that speed translates into a stable, shift-free first visit experience.