upgrade fonttools and fontmake
This commit is contained in:
parent
12d43b99a6
commit
806452ab7f
2 changed files with 19 additions and 12 deletions
|
|
@ -125,6 +125,7 @@ class VarFontProject(FontProject):
|
||||||
self._deep_copy_contours(ufo, glyph, glyph, Transform())
|
self._deep_copy_contours(ufo, glyph, glyph, Transform())
|
||||||
glyph.clearComponents()
|
glyph.clearComponents()
|
||||||
|
|
||||||
|
|
||||||
def _deep_copy_contours(self, ufo, parent, component, transformation):
|
def _deep_copy_contours(self, ufo, parent, component, transformation):
|
||||||
"""Copy contours from component to parent, including nested components."""
|
"""Copy contours from component to parent, including nested components."""
|
||||||
for nested in component.components:
|
for nested in component.components:
|
||||||
|
|
@ -150,13 +151,12 @@ class VarFontProject(FontProject):
|
||||||
conversion_error=None,
|
conversion_error=None,
|
||||||
feature_writers=None,
|
feature_writers=None,
|
||||||
cff_round_tolerance=None,
|
cff_round_tolerance=None,
|
||||||
**kwargs
|
**kwargs,
|
||||||
):
|
):
|
||||||
"""Build OpenType binaries with interpolatable outlines."""
|
|
||||||
# We decompose any glyph with reflected components to make sure
|
# We decompose any glyph with reflected components to make sure
|
||||||
# that fontTools varLib is able to produce properly-slanting interpolation.
|
# that fontTools varLib is able to produce properly-slanting interpolation.
|
||||||
|
|
||||||
self._load_designspace_sources(designspace)
|
designspace = self._load_designspace_sources(designspace)
|
||||||
|
|
||||||
decomposeGlyphs = set()
|
decomposeGlyphs = set()
|
||||||
removeOverlapsGlyphs = set()
|
removeOverlapsGlyphs = set()
|
||||||
|
|
@ -199,6 +199,7 @@ class VarFontProject(FontProject):
|
||||||
)
|
)
|
||||||
rmoverlapFilter.filter(g)
|
rmoverlapFilter.filter(g)
|
||||||
|
|
||||||
|
|
||||||
if ttf:
|
if ttf:
|
||||||
return ufo2ft.compileInterpolatableTTFsFromDS(
|
return ufo2ft.compileInterpolatableTTFsFromDS(
|
||||||
designspace,
|
designspace,
|
||||||
|
|
@ -416,12 +417,15 @@ class Main(object):
|
||||||
|
|
||||||
# decide output filename (or check user-provided name)
|
# decide output filename (or check user-provided name)
|
||||||
outfilename = args.output
|
outfilename = args.output
|
||||||
|
outformat = 'variable' # TTF
|
||||||
if outfilename is None or outfilename == '':
|
if outfilename is None or outfilename == '':
|
||||||
outfilename = os.path.splitext(basename(args.srcfile))[0] + '.var.ttf'
|
outfilename = os.path.splitext(basename(args.srcfile))[0] + '.var.ttf'
|
||||||
log.info('setting --output %r' % outfilename)
|
log.info('setting --output %r' % outfilename)
|
||||||
else:
|
else:
|
||||||
outfileext = os.path.splitext(outfilename)[1]
|
outfileext = os.path.splitext(outfilename)[1]
|
||||||
if outfileext.lower() != '.ttf':
|
if outfileext.lower() == '.otf':
|
||||||
|
outformat = 'variable-cff2'
|
||||||
|
elif outfileext.lower() != '.ttf':
|
||||||
fatal('Invalid file extension %r (expected ".ttf")' % outfileext)
|
fatal('Invalid file extension %r (expected ".ttf")' % outfileext)
|
||||||
|
|
||||||
mkdirs(dirname(outfilename))
|
mkdirs(dirname(outfilename))
|
||||||
|
|
@ -439,7 +443,8 @@ class Main(object):
|
||||||
use_production_names=True,
|
use_production_names=True,
|
||||||
round_instances=True,
|
round_instances=True,
|
||||||
output_path=outfilename,
|
output_path=outfilename,
|
||||||
output=['variable'],
|
output=[outformat],
|
||||||
|
optimize_cff=CFFOptimization.SUBROUTINIZE,
|
||||||
overlaps_backend='pathops', # use Skia's pathops
|
overlaps_backend='pathops', # use Skia's pathops
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,15 @@
|
||||||
fonttools[lxml,unicode,ufo]==3.41.0
|
# note: These should match requirements of fontmake
|
||||||
glyphsLib==3.3.1
|
|
||||||
|
fontmake==2.0.1
|
||||||
|
fonttools[lxml,unicode,ufo]==3.44.0
|
||||||
|
glyphsLib==4.1.2
|
||||||
skia-pathops==0.2.0.post2
|
skia-pathops==0.2.0.post2
|
||||||
ufo2ft==2.8.0
|
ufo2ft==2.9.1
|
||||||
fontmake==1.9.3
|
fs==2.4.10
|
||||||
fs==2.3.0
|
|
||||||
|
|
||||||
# for fontTools/varLib/interpolatable.py
|
# for fontTools/varLib/interpolatable.py
|
||||||
numpy==1.16.3
|
numpy==1.17.1
|
||||||
scipy==1.3.0
|
scipy==1.3.1
|
||||||
munkres==1.1.2
|
munkres==1.1.2
|
||||||
|
|
||||||
# for woff2
|
# for woff2
|
||||||
|
|
|
||||||
Reference in a new issue