Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Latin subsetted fonts are generally 10-30Kb, it's really not that much.

Agreed. Make your own custom font files with only the characters you use, or are likely to use.

> A few milliseconds of a different font appearing is truly not much of an evil, but can be addressed by exactly what the author links in their footnote.

Browsers will wait for about 3 seconds for custom fonts to load before showing a fallback font.

> both of two font files are >140kb, they don't have gzip on

woff2 format fonts are already compressed, so gzip won't do much.



> Browsers will wait for about 3 seconds for custom fonts to load before showing a fallback font

Depends on the `font-display` value on one's `@font-face`, which is where the author's choices of "latency, FOUT, and FOIT" comes from. For instance, Google Fonts uses `swap` by default, meaning the fallback shows right away: https://web.dev/font-best-practices/#choose-an-appropriate-f... (I also think Safari's `auto` font-display never shows fallbacks, but that may have changed)

But if you use `optional`, browsers will attempt to get the custom font into the first paint: https://drafts.csswg.org/css-fonts-4/#valdef-font-face-font-...

That's often enough. You can go another step further and preload the font, which I generally recommend. This especially helps if the font is otherwise discovered late by the browser.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: