Tagged: fonts

How To Download and Install “Google Web Fonts” In Linux

Many large-hearted font designers have made their fonts freely available on the Web. Google has collected the fonts and is hosting them at http://www.google.com/fonts. People mistakenly refer to them as Google Web Fonts. BTW, Google is showing its age. The search result still points to an old link and which arrives at /fonts after a lot of redirections.

You can refer to individual Google fonts in your web page with a header tag. One good thing about these fonts are that they work in IE browsers going as far back as IE 5.5 (Thank you, IE Tester).

On Linux, downloading and installing these fonts is very easy. Here is how I did it.

mkdir goog-web-fonts
cd goog-web-fonts/
wget https://googlefontdirectory.googlecode.com/hg/ofl/ -r -nc -nd -np -A.ttf
sudo mkdir /usr/share/fonts/ttf-goog
sudo cp ./*.ttf /usr/share/fonts/ttf-goog/
fc-cache -r

UPDATE (23 June 2018): Google has moved the fonts to GitHub. Hence, the BASH code changes.

cd ~/Downloads
mkdir ttf-goog-fonts

wget https://github.com/google/fonts/archive/master.zip
unzip fonts-master.zip

find fonts-master -type f -name "*.ttf" > fonts.list
cat fonts.list | while read sReadLine 
  do mv $sReadLine ttf-goog-fonts

sudo cp -R ttf-goog-fonts /usr/share/fonts
fc-cache -r