Skip to content

Commit 6f6159a

Browse files
authored
Create install-google-fonts.sh
1 parent 301969b commit 6f6159a

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

scripts/install-google-fonts.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
_wgeturl="https://github.com/google/fonts/archive/master.tar.gz"
2+
_gf="hindsiliguri"
3+
4+
# install wget
5+
sudo apt-get install wget
6+
7+
# make sure a file with the same name doesn't already exist
8+
rm -f $_gf.tar.gz
9+
10+
echo "Connecting to Github server..."
11+
wget $_wgeturl -O $_gf.tar.gz
12+
13+
echo "Extracting the downloaded archive..."
14+
tar -xf $_gf.tar.gz
15+
16+
echo "Creating the /usr/share/fonts/truetype/$_gf folder"
17+
sudo mkdir -p /usr/share/fonts/truetype/$_gf
18+
19+
echo "Installing all .ttf fonts in /usr/share/fonts/truetype/$_gf"
20+
find $PWD/fonts-master/ -name "*.ttf" -exec sudo install -m644 {} /usr/share/fonts/truetype/google-fonts/ \; || return 1
21+
22+
echo "Updating the font cache"
23+
fc-cache -f > /dev/null
24+
25+
# clean up, but only the .tar.gz, the user may need the folder
26+
rm -f $_gf.tar.gz
27+
28+
echo "Done."

0 commit comments

Comments
 (0)