Skip to content

Instantly share code, notes, and snippets.

@atiensivu
Last active February 5, 2018 21:29
Show Gist options
  • Save atiensivu/1a373414c8fae44543802f550275cdb1 to your computer and use it in GitHub Desktop.
Save atiensivu/1a373414c8fae44543802f550275cdb1 to your computer and use it in GitHub Desktop.
Consolas Font script for Linux downloader and installer
# Requires: wget cabextract
# Assumes license has been agreed to
# Slight variation from https://geek.co.il/2011/10/22/installing-consolas-truetype-font-for-linux
#!/bin/sh
set -e
set -x
mkdir -p ~/Downloads/fonttemp
cd ~/Downloads/fonttemp
echo "Downloading Power Point viewer executable.."
/usr/bin/wget http://download.microsoft.com/download/E/6/7/E675FFFC-2A6D-4AB0-B3EB-27C9F8C8F696/PowerPointViewer.exe
echo "Extracting fonts.."
/usr/bin/cabextract -L -F ppviewer.cab PowerPointViewer.exe
/usr/bin/cabextract -L -F "CONSOL*.TTF" ppviewer.cab
echo "Copying fonts to ~/.fonts.."
mkdir -p ~/.fonts
cp *.ttf ~/.fonts
rm -rf ~/Downloads/fonttemp
echo "Forcing font cache rebuild.."
/usr/bin/fc-cache -r -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment