Re:How to self-host a web font from Google Fonts
by lelandfe on Monday September 15, 2025 @11:58AM
(#45251276)
The default method of loading CSS fonts has no FOUC, so no need to base64 encode. `font-display: swap` introduces FOUC but with a quicker first paint, which some find preferable (in Lighthouse terms, you're trading CLS for FCP).
If you're base64'ing with the intent of loading the font file sooner, just use:
This has the downside of loading a WOFF2 file for all browsers, even ones that don't support WOFF2. These days, ~all browsers support that format: https://caniuse.com/woff2
If you're base64'ing with the intent of loading the font file sooner, just use:
This has the downside of loading a WOFF2 file for all browsers, even ones that don't support WOFF2. These days, ~all browsers support that format: https://caniuse.com/woff2