Skip to content

Instantly share code, notes, and snippets.

@bouroo
Last active April 29, 2020 09:12
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 bouroo/50856235c3df2cd9319bb25aa7a4edf2 to your computer and use it in GitHub Desktop.
Save bouroo/50856235c3df2cd9319bb25aa7a4edf2 to your computer and use it in GitHub Desktop.
Install thai fonts for debian, ubuntu
#!/usr/bin/env bash
if [ "$(whoami)" != "root" ]; then
SUDO=sudo
fi
FONT_DIR="/usr/share/fonts/truetype/"
TH_FONT="http://cloudbox.3bb.co.th/share3/MTUyNjl8MmZjMDJlOTI1OTU1ZDUxNmEwNGU1NGE2MzNmMDU2MDh8OTY2MTc="
echo "Download Thai Font"
#cd ~ && wget -c -O - $TH_FONT | tar zxvf -
curl -L --data 'submit_load=loadfile' ${TH_FONT} > thfont.tar.gz
tar zxvf thfont.tar.gz || exit 1
sleep 3
echo "Add True Type Fonts"
${SUDO} mv -f thfont $FONT_DIR/thfont
${SUDO} chmod 644 $FONT_DIR/thfont/*
${SUDO} rm -rf thfont.tar.gz
${SUDO} fc-cache -fv
echo "---Install Thai Font Finish---"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment