Is it possible to download all google fonts and have them available under Ubuntu? This would help my webdev.
-
I stopped at downloading and checking the script. If the command itself errors out or does not work leave a comment since this is from a 2011 source. – Rinzwind Nov 11 '15 at 15:37
3 Answers
An easier method is to get them directly from Github: https://github.com/google/fonts/tree/master/apache. Each font has its own subdirectory, with uncompressed font files.
There's also a ZIP file of them available from the main https://github.com/google/fonts#readme page.
So, if you want to script this stuff (e.g. regularly download the latest version), you can do it with a Git checkout, or by using wget or curl to pull down the exact files you want.
PS: This thread is a dup of "How do I install fonts?".

- 141
If you trust webupd8:
cd ~/Downloads && wget http://webupd8.googlecode.com/files/install-google-fonts
chmod +x install-google-fonts
./install-google-fonts
In case anyone need to check without downloading: this is the source code for "install-google-fonts":
$ more install-google-fonts
# Original author: Michalis Georgiou <mechmg93@gmail.comr>
# Modified by Andrew http://www.webupd8.org <andrew@webupd8.org>
sudo apt-get install mercurial
_hgroot="https://googlefontdirectory.googlecode.com/hg/"
_hgrepo="googlefontdirectory"
echo "Connecting to Mercurial server...."
if [ -d $_hgrepo ] ; then
cd $_hgrepo
hg pull -u || return 1
echo "The local files have been updated."
cd ..
else
hg clone $_hgroot $_hgrepo || return 1
fi
echo "Mercurial checkout done or server timeout"
sudo mkdir -p /usr/share/fonts/truetype/google-fonts/
find $PWD/$_hgrepo/ -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/t
ruetype/google-fonts/ \; || return 1
fc-cache -f > /dev/null
echo "done."

- 299,756
-
I better do not make my pc dependent on any dubious source. Can I use google fonts for a commercial purpose? – empedokles Nov 14 '15 at 11:46
-
1yes: https://developers.google.com/fonts/ "The fonts in the directory are all released under open source licenses; you can use them on any non-commercial or commercial project." 1st part: you can always remove mercurial when done if that is an issue. All the other parts in the script seem fine to me :) – Rinzwind Nov 14 '15 at 11:49
You can have much easier way with these terminal commands :
sudo apt-get update
sudo apt-get install tasksel
sudo tasksel
And it will show you a bunch of packages collection, and then simply select :
[*] Large selection of font packages
And then give it an OK. Hope it satisfy your design needs :)

- 17
-
That... does not include google-fonts or if it does pulls in a lot more I'd believe. Plus your command can be reduced to 1:
sudo apt-get install {package}^
. The ^ in there makes it a tasksel task. Works for all tasks. – Rinzwind Nov 11 '15 at 18:25 -
Don't know how to select anything. It also had preselections I didn't know how to delete. – empedokles Nov 26 '15 at 16:33