Skip to content

Commit

Permalink
refactor: add build woff2
Browse files Browse the repository at this point in the history
  • Loading branch information
SolidZORO committed Oct 8, 2020
1 parent 45bdd54 commit 1447d8d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
8 changes: 6 additions & 2 deletions tools/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
cd "$(dirname "$0")" || exit

rm -f ./*.ttf

java -jar ./bin/BitsNPicas.jar convertbitmap -f ttf -o ./zpix.ttf ../src/zpix.sfd

# minify has a bug for web, OTS parsing error: OS/2: Failed to parse table
# so I'm going to convert woff2 here
# `ttf2woff2` is a npm module, RUN `npm i -g ttf2woff2` install
cat < ./zpix.ttf | ttf2woff2 > ../docs/zpix.woff2

./minify.py
mv -f ./zpix.ttf ../dist/zpix.ttf


rm -f ./*.bdf

java -jar ./bin/BitsNPicas.jar convertbitmap -f bdf -o ./zpix.bdf ../src/zpix.sfd
mv -f ./zpix.bdf ../dist/zpix.bdf
11 changes: 6 additions & 5 deletions tools/minify.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@

# AutoTrace all glyphs, add extrema and simplify.
print('Processing...')
baseFont.selection.all()
baseFont.autoTrace()
baseFont.addExtrema()
baseFont.simplify()
# baseFont.selection.all()
# baseFont.autoTrace()
# baseFont.addExtrema()
# baseFont.simplify()
baseFont.generate('zpix.ttf', 'ttf')
baseFont.close()

print(' ')
print('🚀 Done!')
print(' ')
print(' ')

0 comments on commit 1447d8d

Please sign in to comment.