Let’s get this straight: The effort to host Google web fonts on your own server is immense! First of all you need to download all
.svg files, then copy them onto your server and finally paste a CSS snippet.
Sounds easy? Well it could be, if Google would actually provide any direct links to download these files and a customized CSS for self-hosting them. To fix this problem without using font generation services like Font Squirrel, I decided to publish a little service called google-webfonts-helper.
Just for reference: Before creating this service I’ve used an awesome bash script by Clemens Lang to download Google fonts in all formats. So Kudos to him, my service builds upon his idea!
Your generated archive only includes required files based on selected styles, formats and charsets. 4-steps instruction. A special Thank you goes to the 212 stargazers, you are awesome!
UI improvements, CSS code highlighting, step by step instructions.
Font subsets (e.g.
cyrillic, …) are now customizable.
Seriously, I have not expected so much popularity: 169 stargazers. Thank you so much!
Wow, this project has gone quite popular after submitting it to Hackernews! 33 stargazers and 35 comments (and rank 7 in the news section at peak time). Thank you!
Example: Self-host Open Sans in 4 easy steps!
The service uses Google’s font API to retrieve a list of all available web fonts, fetches links to the
.svg files by parsing their hosted CSS files (and faking the
User-Agent to get them). It downloads all font formats and generates a customized archive with all your selected styles, formats and charsets. In combination with the CSS snippet (whose folder prefix can be customized) you should be ready to self-host your font immediately. Here’s how this looks like currently:
Internally, I’m using the (M)EAN stack (without MongoDB) as I really needed some practice with Angular and Express. Restful services are great and I can recommend anyone starting up a small project like this to take a look at the yeoman angular-fullstack generator. Without prior knowledge, I came up with a working prototype in less than 5 hours! Freaking productive work flow.