Live data from Hacker News

Self-host your fonts for better performance

wicki.io

71–80 of 417 posts

Re: Self-host your fonts for better performance

#71
I'm wondering about commercial CDNs for font serving such as by Adobe and Monotype. Last I checked, these require hosting on their properties, or alternatively pinging their counter so that they can enforce their volume licensing. Only last year, there were still type foundries left that would license on a trust base; but these have gone away/bought by Monotype such as URW+ who once created free fonts for F/OSS operating systems (in my home town even). But isn't the practice of pinging or pulling from a third-party domain before presenting a consent dialog a GDPR violation?

Re: Self-host your fonts for better performance

#72

The convenience is the major factor. When self hosting, you have to manually take into account stuff like font format, fallbacks for older browsers, preloading considerations, hinting or no hinting, variable or not variable, and manage the (often long) CSS yourself, and keep it updated as browser compatibility and technology changes. Google does all this for you with the inclusion of a single line. But yes, the drawb…

I use webpack and fonts packaged in NPM. It takes exactly two lines, one in the package.json and one import.

Re: Self-host your fonts for better performance

#73

The convenience is the major factor. When self hosting, you have to manually take into account stuff like font format, fallbacks for older browsers, preloading considerations, hinting or no hinting, variable or not variable, and manage the (often long) CSS yourself, and keep it updated as browser compatibility and technology changes. Google does all this for you with the inclusion of a single line. But yes, the drawb…

Why hasn’t w3c taken on some way to avoid the unnecessary complexity?

(Simplified font definition and usage standard.)

Re: Self-host your fonts for better performance

#74

Earlier quoted context omitted.

If you want a really fast web experience, try disabling images and javascript too! (on rereading this I sounded sarcastic, but I really wasn’t trying to be)

uBlock Origin has a setting to prevent loading elements above certain size. I personally find it to be a nice middle ground. https://github.com/gorhill/uBlock/wiki/Per-site-switches#no-...

thx. didn't know about this option. uBlock Origin is just great!

Re: Self-host your fonts for better performance

#75
post #23

I've always wondered the legality of downloading web fonts from Google Fonts and self-hosting them. At first glance it probably doesn't sound like a problem, I get it's effectively the same as serving them from Google, but I know fonts can also sometimes have strange licensing requirements… so I always figured it was safer just to avoid it entirely.

Wonder no more!

"The open source fonts in the Google Fonts catalog are published under licenses that allow you to use them on any website, whether it’s commercial or personal."

https://developers.google.com/fonts/faq

This would be the opportunity for them to tell us that applies only to fonts delivered via CDN. On the contrary, they later recommend self-hosting.

Re: Self-host your fonts for better performance

#76
post #5

I'm usually the first one to sneer in disbelief at super users who 'go nuclear' and disable the likes of javascript and images when browsing the web, but lately, I've been experimenting with having custom fonts disabled (that is, fonts I don't have locally), and it feels to me that page loads are much faster, and in some case more readable (pages feel 'cleaner'?). The only issues I've come across so far is when a sit…

As a guy who does this blocking pretty ruthlessly (edit: inc. cookies), I'd like to understand why - I don't take offence at 'sneer', ISWYM but I'd like to understand the other side of the fence. TIA

Re: Self-host your fonts for better performance

#78
Wondering if let's say I am Cloudflare, Fastly or another popular CDN provider. I'm already acting as a reverse proxy to the host. Would it make sense to rewrite calls to my own CDN so that requests could be done in parallel from browser side and then I could cache all Google Fonts, JS libraries, etc? Surely would need to be an optional feature that could be on/off by customers. But if we know performance is negatively impacted by third party loading of popular libraries, would cloning them and rewriting make sense?

Re: Self-host your fonts for better performance

#80
post #39

Earlier quoted context omitted.

How does one do this for chrome/firefox? Google search gives result for the opposite problem.

firefox options -> language and appearance -> advanced -> uncheck 'Allow pages to choose their own fonts, instead of your selections above'

Won't this break the UI of most sites because they (ab)use web fonts to add icons?

It's annoying to hit a page with a video player, and all the buttons are little boxes with numbers in them because the icon font didn't load...

Post reply on HN