News for hackers. Stuff that matters.
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:

     <link rel="preload" href="/assets/my-font.woff2" as="font" type="font/woff2" crossorigin>
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

There are no comments on this comment yet.