neverpanic / google-font-download

Locally host Google's web fonts
https://neverpanic.de/blog/2014/03/19/downloading-google-web-fonts-for-local-hosting/
BSD 2-Clause "Simplified" License
706 stars 72 forks source link

Updating, Font Awesome, and other fonts #8

Closed rieje closed 8 years ago

rieje commented 8 years ago
  1. Rather than just focusing on Google's web fonts, have you considered doing the same thing but for Font Awesome? Disabling web fonts (not letting CDN deliver fonts for privacy reasons) such as Font Awesome replaces the glyphs (icon characters) with a placeholder that has no meaning, which actually affects usability of a webpage because unlike text fonts, there's no fallback to a default font. For example, without realizing that a magnifying glass glyph exists because web font was disabled, the user would not know something involved "searching" was involved. Font Awesome's licensing allows it too.
  2. How does updating the local copy of the font work? When the CDN delivers fonts, requests are made to check if newer versions are available every time, even if the font is cached.
  3. How difficult is it to tailor the script to locally host other fonts whose licensing allows it? I was thinking of using it to download the most popular fonts so even if I disable CDN delivery of web fonts via uBlock Origin, not much is changed from the user experience if a bunch of fonts are delivered locally.

P.S. Decentraleyes addon for Firefox is doing something similar, not with fonts but with scripts and content. Perhaps there can be a merge or exchange of ideas or something. You probably already know this though.

neverpanic commented 8 years ago

I have not considered doing this for Font Awesome, and the current script would likely need some refactoring to be useful for other services. I like the idea, but I do not have time or a use case to invest the development time at the moment. I see a couple of challenges:

I'm aware of the glyph problem and solving this in some way would really be a nice idea, since I surf with NoScript and a lot of webpages don't render the glyphs without JavaScript.

There is no automated mechanism to update the local copy of your font. You could easily set up a cronjob that periodically updates the fonts, but I wouldn't want a completely automated approach since you might want to test your site with the updated fonts first.

I see this script as a piece of the puzzle that would allow you to keep a local copy of the most popular fonts. You would likely need a browser extension to rewrite the URLs of the fonts to a local resource. You'd also have to deal with browser policies, because modern browsers usually don't allow websites to access local data directly (i.e. you'd need a local webserver). Additionally, if you wanted this to work for non-google fonts, you would have to implement support for other providers first. Overall, I do not see a browser extension in the scope of this project. google-font-download is merely a tool to download the font files and generate CSS and is intended for website owners who don't want to rely on Google's CDN.