Skip to content

Instantly share code, notes, and snippets.

@mneko22
Last active September 26, 2019 11:03
Show Gist options
  • Save mneko22/4c9a6f79bb22effb7439b56f41c06916 to your computer and use it in GitHub Desktop.
Save mneko22/4c9a6f79bb22effb7439b56f41c06916 to your computer and use it in GitHub Desktop.
generate_ricty
#!/bin/bash
currentdir=$(pwd)
tempdir=$(mktemp -d temp.XXXX)
function failDlFile () {
echo "Failed download fonts"
echo "clean tempolary directory"
cd $currentdir
rm -rf $tempdir
exit 1
}
cd $tempdir
echo "downlaod create script"
wget https://www.rs.tus.ac.jp/yyusa/ricty/ricty_generator.sh
if [ ! -f ricty_generator.sh ]; then
failDlFile
fi
chmod +x ricty_generator.sh
echo "start download fonts"
echo "downloading inconsolata"
wget https://github.com/google/fonts/raw/master/ofl/inconsolata/Inconsolata-Bold.ttf
if [ ! -f Inconsolata-Bold.ttf ]; then
failDlFile
fi
wget https://github.com/google/fonts/raw/master/ofl/inconsolata/Inconsolata-Regular.ttf
if [ ! -f Inconsolata-Regular.ttf ]; then
failDlFile
fi
echo "downloading Migu 1M"
wget --trust-server-names "https://ja.osdn.net/frs/redir.php?m=jaist&f=mix-mplus-ipa%2F63545%2Fmigu-1m-20150712.zip"
if [ ! -f migu-1m-20150712.zip ]; then
failDlFile
fi
unzip migu-1m-20150712.zip
mv migu-1m-20150712/*.ttf ./
if [ ! -f migu-1m-regular.ttf ] && [ ! -f migu-1m-bold.ttf ]; then
failDlFile
fi
echo "start generate ricty"
./ricty_generator.sh ./Inconsolata-Regular.ttf ./Inconsolata-Bold.ttf ./migu-1m-regular.ttf ./migu-1m-bold.ttf
mv Ricty* $currentdir
echo "crean temporary directory"
cd $currentdir
rm -rf $tempdir
echo "finish!"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment