Blame fetchtwfont.sh

Peng Wu 70733b7
#!/bin/bash
Peng Wu 70733b7
#Try to get upstream latest files
Peng Wu 70733b7
Peng Wu 70733b7
LANG="TW"
Peng Wu 70733b7
PREFIX="SourceHanSans$LANG"
Peng Wu 70733b7
VERSION="1.001"
Peng Wu 70733b7
ARCHIVE="$PREFIX-$VERSION"
Peng Wu 70733b7
TMPDIR=$(mktemp -d --tmpdir=/var/tmp fetchtwfont-XXXXXXXXXX)
Peng Wu 70733b7
[ $? != 0 ] && exit 1
Peng Wu 70733b7
umask 022
Peng Wu 70733b7
pushd "$TMPDIR"
Peng Wu 70733b7
Peng Wu 70733b7
URLPREFIX="https://github.com/adobe-fonts/source-han-sans/raw/release/SubsetOTF"
Peng Wu 70733b7
VARIANTS="Bold ExtraLight Heavy Light Medium Normal Regular"
Peng Wu 70733b7
Peng Wu 70733b7
for i in $(echo $VARIANTS | tr " " "\n")
Peng Wu 70733b7
do wget "$URLPREFIX/$LANG/$PREFIX-$i.otf"
Peng Wu 70733b7
done
Peng Wu 70733b7
Peng Wu 70733b7
mkdir "$ARCHIVE"
Peng Wu 70733b7
mv $PREFIX-*.otf "$ARCHIVE"
Peng Wu 70733b7
chmod -x $ARCHIVE/*.otf
Peng Wu 70733b7
zip "$ARCHIVE.zip" $ARCHIVE/*.otf
Peng Wu 70733b7
popd
Peng Wu 70733b7
mv "$TMPDIR/$ARCHIVE.zip" .
Peng Wu 70733b7
rm -fr "$TMPDIR"