FontSource releases all of google fonts and more as NPM packages: https://fontsource.org

this is really fascinating considering that they package it as a npm package which is then used by jsdelivr which is essentially a free really low latency sponsored/(essentially operated?) by cloudflare and fastly etc.

I just checked and jsdelivr has had like 300 billion requests past month and over 16,813 TB

Really fascinating stuff. I will try to use this from now on! (earlier I was thinking of using something like coollabs.io but I checked its code and I see that the fonts are served through something like bunnycdn from coollabs side which is cool but still)

Honestly, what other things would be better off packaged as npm packages as I never thought that packaging fonts as npm package should make so much sense but here we are!

Bookmarked!!

> I just checked and jsdelivr has had like 300 billion requests past month and over 16,813 TB

My brain breaking because I don’t know if that comma denotes thousand or decimal in this context.

They have left a space in the website so like 16 813 TB as an example.

Knowing about npm / js I genuinely think that it might in the thousands in this context (I think)

Someone should confirm it I suppose

Wow

Insane to think about fonts and all this bandwidth.

Skip the middleman with coolab? https://fonts.bunny.net/

With a zero-tracking and no-logging policy, Bunny Fonts helps you stay fully GDPR compliant and puts your user's personal data into their own hands. Additionally, you can enjoy lightning-fast load times thanks to bunny.net's global CDN network to help improve SEO and deliver a better user experience.

Do you work for bunnyCDN? This sounds more like a sales pitch than a honest recommendation.

Not associated and not a customer. It was a copy paste from the page.

You don't need to use bunny when you can use fontsource with something like jsdelivr I think that jsdelivr is also gdpr compliant considering how much they are used, right?

How is this service financially supported? The website offers no clues.

This is the way to do it!

But i don't know how to use NPM.

you don't need npm; you can just link to the cdn https://fontsource.org/fonts/inter/cdn

That's not self hosting

+1 I can understand if author doesn't know how to use npm just for fonts yknow but he should definitely look to your comment and respond what his opinions are on the matter

Definitely curious as this seems a much better way to handle things ergonomically instead of the way author suggested way

I also feel like hosting your own cdn is definitely easy with this by just downloading npm package or embedding it directly I suppose?

There are definitely other ways to do this too. This discussion was really fun as I saw so many ways to embed fonts other than what I had known but this seems to be a mix and match between privacy and not having to embed it myself.

Now you have two problems.