summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorRasmus Andersson <rasmus@notion.se>2019-09-04 05:35:42 +0300
committerRasmus Andersson <rasmus@notion.se>2019-09-04 05:35:42 +0300
commit806452ab7f26f69550b61e05e72b2d6f49c716c0 (patch)
tree6603a235c132b0f729d70505ab4e54fcb199a24a /misc
parent12d43b99a62c0acec6fc37c576fadca9d08002b3 (diff)
downloadinter-806452ab7f26f69550b61e05e72b2d6f49c716c0.tar.xz
upgrade fonttools and fontmake
Diffstat (limited to 'misc')
-rwxr-xr-xmisc/fontbuild15
1 files changed, 10 insertions, 5 deletions
diff --git a/misc/fontbuild b/misc/fontbuild
index 58ce34e73..6ee3f8fdc 100755
--- a/misc/fontbuild
+++ b/misc/fontbuild
@@ -125,6 +125,7 @@ class VarFontProject(FontProject):
self._deep_copy_contours(ufo, glyph, glyph, Transform())
glyph.clearComponents()
+
def _deep_copy_contours(self, ufo, parent, component, transformation):
"""Copy contours from component to parent, including nested components."""
for nested in component.components:
@@ -150,13 +151,12 @@ class VarFontProject(FontProject):
conversion_error=None,
feature_writers=None,
cff_round_tolerance=None,
- **kwargs
+ **kwargs,
):
- """Build OpenType binaries with interpolatable outlines."""
# We decompose any glyph with reflected components to make sure
# that fontTools varLib is able to produce properly-slanting interpolation.
- self._load_designspace_sources(designspace)
+ designspace = self._load_designspace_sources(designspace)
decomposeGlyphs = set()
removeOverlapsGlyphs = set()
@@ -199,6 +199,7 @@ class VarFontProject(FontProject):
)
rmoverlapFilter.filter(g)
+
if ttf:
return ufo2ft.compileInterpolatableTTFsFromDS(
designspace,
@@ -416,12 +417,15 @@ class Main(object):
# decide output filename (or check user-provided name)
outfilename = args.output
+ outformat = 'variable' # TTF
if outfilename is None or outfilename == '':
outfilename = os.path.splitext(basename(args.srcfile))[0] + '.var.ttf'
log.info('setting --output %r' % outfilename)
else:
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)
mkdirs(dirname(outfilename))
@@ -439,7 +443,8 @@ class Main(object):
use_production_names=True,
round_instances=True,
output_path=outfilename,
- output=['variable'],
+ output=[outformat],
+ optimize_cff=CFFOptimization.SUBROUTINIZE,
overlaps_backend='pathops', # use Skia's pathops
)