How can I download WOFF files from Google Fonts?

CssFontsCross BrowserGoogle Font-Api

Css Problem Overview


Google Fonts seems to only offer fonts in WOFF2.

While this works fine with Chrome, WOFF2 doesn't seem to be supported by many other browsers

Is there a way to directly link to Google fonts hosted on their CDN in a format other than WOFF2?

Css Solutions


Solution 1 - Css

Unfortunately Google does not offer an easy way to directly download fonts. You can browse the git repository to search for the file you want, though there are only TTF files on GitHub available.

Also, do not directly link to the GitHub hosted fonts in your CSS! GitHub serves the files with the wrong mime type, which causes issues in some browsers.

While there is not a mainstream CDN for all the formats, you can use http://google-webfonts-helper.herokuapp.com to download the font files and host them yourselves.

Solution 2 - Css

When I open the following URL in Chrome, I get a link to the font in woff2 format. When I use Firefox, it's in woff format and in an Android device running pre-4.4, it is in ttf format.

http://fonts.googleapis.com/css?family=Open+Sans

So it appears that Google delivers fonts in a format appropriate to the requesting user-agent.

Solution 3 - Css

Another option is using the following (node) gulp package: gulp-google-webfonts.

Once installed it takes moments to install fonts and create corresponding css.

Note that when installing a Google Font with whitespace in the name, (you don't escape it) reference it with the plus sign as follows:

fonts.list

Cabin+Sketch:400

Solution 4 - Css

You can use [everythingfonts.com][1] to convert the ttf file to a woff file.

[1]: https://everythingfonts.com/ttf-to-woff "everythingfonts.com"

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestioncantsayView Question on Stackoverflow
Solution 1 - CssudondanView Answer on Stackoverflow
Solution 2 - CssDheeraj VepakommaView Answer on Stackoverflow
Solution 3 - CssMikeiLLView Answer on Stackoverflow
Solution 4 - CssisapirView Answer on Stackoverflow