Created
January 23, 2017 14:15
-
-
Save iamso/5c68aa70ffda8a5fffc271ca58249605 to your computer and use it in GitHub Desktop.
Convert fonts to .woff and .woff2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
cd "$PWD" | |
shopt -s globstar | |
for f in *.otf *.ttf ; do | |
FILE=$(basename "$f") | |
if [ "$FILE" != "." ] && [ "$FILE" != ".." ] && [ "$FILE" != "*.otf" ] && [ "$FILE" != "*.ttf" ] | |
then | |
echo "Converting $FILE" | |
sfnt2woff-zopfli $FILE >/dev/null | |
woff2_compress $FILE >/dev/null | |
fi | |
done | |
echo "" | |
echo "All done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
requires the
sfnt2woff-zopfli
andwoff2
command line tools to be installed