# step 1: export default from website an place in src/fonts/website-export/CommitMono.zip
# step 2: make sure fontforge and ttfautohint is installed
# step 3: run this from the root directory

rm src/fonts/*.zip
mkdir src/fonts/CommitMono-1.143
mv src/fonts/website-export/CommitMono.zip src/fonts/CommitMono-1.143/CommitMono.zip
cd src/fonts/CommitMono-1.143
unzip CommitMono.zip
rm CommitMono.zip
mkdir ttfautohint
fontforge -lang ff -c 'Open("CommitMono-400-Regular.otf"); Generate("CommitMono-400-Regular-unhinted.ttf")'
fontforge -lang ff -c 'Open("CommitMono-400-Italic.otf"); Generate("CommitMono-400-Italic-unhinted.ttf")'
fontforge -lang ff -c 'Open("CommitMono-700-Regular.otf"); Generate("CommitMono-700-Regular-unhinted.ttf")'
fontforge -lang ff -c 'Open("CommitMono-700-Italic.otf"); Generate("CommitMono-700-Italic-unhinted.ttf")'
ttfautohint -R CommitMono-400-Regular-unhinted.ttf -a sss CommitMono-400-Regular-unhinted.ttf ttfautohint/CommitMono-400-Regular.ttf
ttfautohint -R CommitMono-400-Regular-unhinted.ttf -a sss CommitMono-400-Italic-unhinted.ttf ttfautohint/CommitMono-400-Italic.ttf
ttfautohint -R CommitMono-400-Regular-unhinted.ttf -a sss CommitMono-700-Regular-unhinted.ttf ttfautohint/CommitMono-700-Regular.ttf
ttfautohint -R CommitMono-400-Regular-unhinted.ttf -a sss CommitMono-700-Italic-unhinted.ttf ttfautohint/CommitMono-700-Italic.ttf
rm CommitMono-400-Regular-unhinted.ttf
rm CommitMono-400-Italic-unhinted.ttf
rm CommitMono-700-Regular-unhinted.ttf
rm CommitMono-700-Italic-unhinted.ttf
cd ..
zip -vr CommitMono-1.143.zip CommitMono-1.143/ -x "*.DS_Store"
rm -R CommitMono-1.143
cd ..
cd ..

# step 4: upload src/fonts/CommitMono.zip to GitHub