Skip to content

Fonts Without Regret: Fast Loads, No CLS

How fonts hurt LCP/CLS, when to preload, how font-display works, and practical strategies to avoid layout shift with good typography.

Rajesh DhimanMarch 01, 20262 min read
On this page

What you’ll learn

  • Why fonts cause FOIT/FOUT and CLS
  • When preload helps
  • How to pick a strategy that’s fast and visually stable

30‑second interview answer

Fonts can delay text rendering and cause layout shifts. Use font-display to control fallback behavior, preload only the critical font files, subset and compress fonts (WOFF2), and reduce CLS by choosing fallback fonts with similar metrics (or using size-adjust where supported). The goal is: readable content fast, minimal layout movement.


Case study (real): frontendinterview.in

Quick lab snapshot on homepage and /blog:

  • Homepage CLS: 0.00
  • Blog CLS: 0.00

That’s exactly what we want: the UI isn’t shifting during load.

The takeaway isn’t “fonts never matter” — it’s that your current font strategy is stable. As you add more typography (different weights, more fonts, marketing sections), keep this same standard:

  • reserve space (avoid swapping in fonts with wildly different metrics)
  • preload only the fonts that affect above-the-fold content

The two main font problems

1) Slow text paint (LCP impact)

If your headline is the LCP element, fonts can directly affect LCP.

2) Layout shift (CLS)

When the web font loads late and swaps in with different metrics, lines reflow.


font-display in one table

  • block → hides text briefly (FOIT) → can hurt perceived performance
  • swap → shows fallback immediately (FOUT) → best for speed, can cause CLS
  • optional → may skip font if slow → great for performance, style might differ

Most production sites start with swap and then fix CLS using metric-compatible fallbacks.


Preload (only when it’s critical)

If a font is needed for above-the-fold content:

<link
  rel="preload"
  href="/fonts/inter-var.woff2"
  as="font"
  type="font/woff2"
  crossorigin
/>

Don’t preload many fonts. It competes with CSS/JS/images.


CLS prevention strategies

Strategy A: Use a metric-compatible fallback

Pick a fallback font with similar x-height/width.

Strategy B: Reduce font variants

Less variants → fewer downloads.

Strategy C: Subset your fonts

Ship only the glyphs you need.


Common mistakes

  • Preloading every font variant
  • Serving TTF/OTF on the web (use WOFF2)
  • Not using crossorigin → preload becomes ineffective

Production rule of thumb

  • WOFF2 only
  • Preload one critical font (if needed)
  • font-display: swap + CLS-safe fallback metrics

Quick recap

  • Fonts affect LCP and CLS.
  • Preload sparingly.
  • Use font-display intentionally and pick fallbacks that don’t shift layout.
Companion Book

Looking for structured, offline interview prep?

Free online lessons • Portable Amazon Kindle / Paperback

Frontend Interview Guide (2025 Edition) cover
Recommended for React & Frontend Rounds

Frontend Interview Guide (2025 Edition)

By Rajesh Dhiman

Comprehensive preparation covering React internals, Web Performance, CSS architecture, and system design questions.

View on Amazon ↗Kindle & Paperback
JavaScript Interview Guide cover
Recommended for Core JS Rounds

JavaScript Interview Guide

By Rajesh Dhiman

Deep dive into the Event Loop, microtask draining, closures, prototypal inheritance, and asynchronous execution patterns.

View on Amazon ↗Kindle & Paperback

Note: All lessons on Frontend Interview remain completely free to read online. As an Amazon Associate, we may earn from qualifying purchases.

RD

Written by Rajesh Dhiman

Authored by Rajesh Dhiman and engineered at Eunix Tech. Focused on deep-dive frontend engineering, JavaScript runtime internals, React architecture, and web performance.