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

Or better yet, include the ttf/woff/woff2 files inside your project as an npm package using Fontsource[0].

[0]: https://github.com/fontsource/fontsource



Won’t that cause the fonts to download again if they were loaded by Google fonts? I thought the reason to use something like Google fonts was to have the fonts download only once.


That hasn’t worked for a while. Browsers will NOT use cached resources loaded for foo.com when loading bar.com, even if they are the same resource from the same CDN.


Can you provide a link to support / verify this?




Or even better just don't use custom fonts because they break a lot of things anyway.


I wish there was a way to use KaTeX/MathJax without custom fonts.


Can you give some examples? Custom web fonts have been well supported since the late aughts.


They're a big reason pages load slowly and cause text to jump around when they do. Custom web fonts are awful.


Web fonts are pretty small and only load if used, and loaded only if they're not cached. It's definitely added requests, but those can be deferred intelligently.

Reflowing is preventable using modern techniques, but honestly it doesn't seem like that big of a deal. The tradeoff is you get access to lots of different type options. More type options means more you can convey with type, which is a good thing for people who need to communicate on the web. It's more than just marketing sometimes.


Font variety help legibility through creating distinctions in context and hierarchy, though.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: