Skip to content

Instantly share code, notes, and snippets.

@barning
Created March 9, 2021 14:05
Show Gist options
  • Save barning/01c960130acfa6aad7ff1ad4696bf5a4 to your computer and use it in GitHub Desktop.
Save barning/01c960130acfa6aad7ff1ad4696bf5a4 to your computer and use it in GitHub Desktop.
Convert from Woff2 to Woff
#!/bin/bash
# Thanks to https://github.com/jens-t
# https://rsms.me/fonttools-docs/subset.html
# https://unicode-table.com/en/#basic-latin
# sudo pip install fonttools brotli
for FILENAME in ./*.woff2; do
NAME=$(echo `basename $FILENAME` | awk -F"." '{print $1}')
pyftsubset $FILENAME --flavor=woff --output-file=./woff/$NAME.woff
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment