Combining font-display with Preloading
What you'll learn: How to use preload hints with font-display to get the best of both worlds—early font discovery and controlled fallback behavior.
The Synergy of Two Optimization Techniques
You've learned that font-display controls how fonts render when they arrive, and preloading tells the browser to fetch resources earlier. When combined, they create optimal perceived performance for web fonts.
Here's the problem they solve together: normally, browsers discover fonts late in the page-load process (only after parsing CSS). By the time the browser requests the font, precious milliseconds have been lost. Meanwhile, font-display waits patiently, but can't speed up the actual fetch.
How to Combine Them
Use a <link> tag with rel="preload" in your HTML <head>, before your stylesheet link:
<link rel="preload"
href="fonts/body-text.woff2"
as="font"
type="font/woff2"
crossorigin>
<link rel="stylesheet" href="styles.css">
Then in your CSS, apply font-display:
@font-face {
font-family: 'BodyFont';
src: url('fonts/body-text.woff2') format('woff2');
font-display: swap;
}
Why This Works
Think of it like ordering food for delivery: preloading is calling ahead to place your order before you're even hungry, while font-display is deciding whether to eat a snack (fallback font) while waiting, or just hold out.
Preloading cuts 200-500ms off font arrival time. font-display: swap ensures users see readable text immediately. Together, users see content fast and fonts arrive sooner.
Best practice: Only preload 1-2 critical fonts (usually body text and headings) to avoid wasting bandwidth.
Key Takeaway: Preloading discovers fonts early, font-display controls fallback behavior—together they minimize both blank text and layout shift for optimal perceived performance.