jquery / jquery-wp-content

WordPress themes and plugins for the jQuery sites
GNU General Public License v2.0
253 stars 169 forks source link

Improve font-loading performance (avoid Typekit JS) #446

Closed Krinkle closed 8 months ago

Krinkle commented 1 year ago

Instead of using Adobe Typekit JS, perhaps we can load a bundle one or two font-files directly and load using CSS @font-face.

Krinkle commented 1 year ago

It seems this isn't possible with the current font family.

Klavika is not released under the SIL Open Font License, nor under any other free software license. This is probably why it is not available through Google Fonts either. It is exclusive to Adobe Typekit.

The official page for this font says at https://fonts.adobe.com/fonts/klavika#licensing-section:

purchase additional licensing and services [for] […]:

  • Self Hosting: Host web font files on your own server

And the general license FAQ from Adobe says, at https://helpx.adobe.com/fonts/using/font-licensing.html#web-host:

Can I host the web font files on my own server?

No. Adobe doesn't offer the ability to locally host fonts. Our web font hosting delivers fonts from a globally-distributed content delivery network (CDN), which performs much better and is more scalable than using local hosting for static assets.

Apart from the blatant perf misinformation in their justification, the bottom line is that the license doesn't permit self-hosting. Given the otherwise free and unlimited distribution they permit, this might hint at some kind of "you pay us with your data" underneath it. But either way, we cannot self-host this font as a way to improve privacy and performance.

Krinkle commented 1 year ago

A close match might be the open font Cairo SemiBold. The letters where Klavika seems most recognisable is in its attitude toward "Q", "y" and "a"; which Cairo taks a similar approach on, and has an overall similar spacing and sans thickness.

https://fonts.google.com/specimen/Cairo?preview.text=jQuery%20API%20.addBack()&preview.text_type=custom

Klavika 700 Cairo 700
Screenshot 2023-09-18 at 10 21 52 Screenshot 2023-09-18 at 10 21 56
timmywil commented 9 months ago

I searched around on some sites that recommend fonts similar to Klavika, but I don't think any of them were as close as Cairo.