I have a template and it has a reference to a Google font like this:
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600,300' rel='stylesheet' type='text/css'>
How can I download it and set it up to use in my pages which are running offline all the time?
When using Google Fonts, your workflow is divided in 3 steps : "Select", "Customize", "Embed". If you look closely, at the right end of the "Use" page, there is a little arrow which allows you to download the font currently in your collection.
After that, and once the font is installed on your system, you just have to use it like any other regular font using the
font-family
CSS directive.Check out google webfonts helper
It lets you download every web font of Google and suggests css code for the implementation. This tool also allows you to simply download all formats at once without the hassle.
Also take a look at their Github page.
Take a look at this handy article to explain how to use Google fonts offline
Essentially you are including the font into your project.
I followed duydb's answer to produce the python code below that automates this process.
Hope this helps with some of the copy-paste death.
You need to download the font and reference it locally.
Download the
CSS
from the link you posted, then download all of theWOFF
files and (if needed) convert them toTTF
.Then change the
CSS
from the link you posted to include the fonts locally.From
To
Voila! There might be some more you need to do but the above is the basics. This article explains a little better.
Found a step-by-step way to achieve this (for 1 font):
(as of Sep-9 2013)
That's it. Cause I had the same problem and the solution on top did not work for me.