Upgrade fontmake to 1.10.1, use fonttools for woff2

parent af29dab0
Pipeline #67185614 passed with stages
in 12 minutes and 38 seconds
......@@ -28,7 +28,7 @@ $(BLDDIR)/%.ttf: $(SRCDIR)/%.ufo
$(BLDDIR)/%.woff2: $(BLDDIR)/%.otf
@echo "WEBFONT $(@F)"
@$(PY) $(webfontscript) -i $<
@fonttools ttLib.woff2 compress $<
$(BLDDIR)/%.pdf: $(BLDDIR)/%.otf $(tests)
@echo " TEST $(@F)"
#!/usr/bin/env python
# encoding: utf-8
# Webfont build utility
from fontTools.ttLib import TTFont
from fontTools.ttx import makeOutputFileName
import argparse
def webfonts(infont, type):
font = TTFont(infont, recalcBBoxes=0)
woffFileName = makeOutputFileName(
infont, outputDir=None, extension='.' + type)
font.flavor = type
font.save(woffFileName, reorderTables=False)
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='Build webfonts')
parser.add_argument('-i', '--input', help='Input font', required=True)
args = parser.parse_args()
webfonts(args.input, 'woff')
webfonts(args.input, 'woff2')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment