Font Loading Problems
Web fonts can cause Flash of Invisible Text (FOIT), Flash of Unstyled Text (FOUT), and layout shifts when fonts swap. Proper optimization prevents these issues.
Font Optimization Techniques
Use font-display
font-display: swap shows fallback text immediately. font-display: optional may skip the web font on slow connections.
Preload Critical Fonts
Use <link rel='preload' as='font'> for fonts needed above the fold.
Subset Fonts
Only include character sets you need. Tools like glyphhanger can create subsets.
Self-Host Fonts
Self-hosting eliminates third-party requests. Use woff2 format for best compression.
Consider Variable Fonts
Variable fonts combine multiple weights in one file, reducing total font payload.