Skip to content

Instantly share code, notes, and snippets.

@Ark74
Forked from keeferrourke/install-google-fonts.sh
Last active October 10, 2018 18:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ark74/a803fe4093adf0ef10dad60f601de902 to your computer and use it in GitHub Desktop.
Save Ark74/a803fe4093adf0ef10dad60f601de902 to your computer and use it in GitHub Desktop.
A bash script to install all Google Fonts, system wide, on debian based systems (ex. Ubuntu)
#!/bin/sh
# Written by: Keefer Rourke <https://krourke.org>
# Based on AUR package <https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ttf-google-fonts-git>
# dependancies: fonts-cantarell, ttf-ubuntu-font-family, git
sudo apt-get install fonts-cantarell, ttf-ubuntu-font-family, git
srcdir="/tmp/google-fonts"
pkgdir="/usr/local/share/fonts"
giturl="git://github.com/google/fonts.git"
mkdir $srcdir
cd $srcdir
echo "Cloning Git repository..."
git clone $giturl
echo "Installing fonts..."
sudo mkdir -p $pkgdir
sudo find $srcdir -type f -name "*.ttf" -exec install -Dm644 {} $pkgdir \;
echo "Cleaning up..."
sudo find $pkgdir -type f -name "Cantarell-*.tff" -delete \;
sudo find $pkgdir -type f -name "Ubuntu-*.tff" -delete \;
# provides roboto
sudo apt-get --purge remove fonts-roboto
echo "Updating font-cache..."
sudo fc-cache -f > /dev/null
echo "Done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment