From 0d2e8746cf7cc98efd117f2a462211bd6ceddc94 Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Thu, 12 Feb 2015 16:32:01 -0800 Subject: Use FontForge for overlap removal. This is an alternative to the closed source AFDKO checkOutlines tool. Again, we could potentially do our own overlap removal if time permits. --- scripts/lib/fontbuild/Build.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'scripts/lib/fontbuild/Build.py') diff --git a/scripts/lib/fontbuild/Build.py b/scripts/lib/fontbuild/Build.py index 0f398ca..7cb4963 100644 --- a/scripts/lib/fontbuild/Build.py +++ b/scripts/lib/fontbuild/Build.py @@ -164,15 +164,20 @@ class FontProject: newFont = OpenFont(ufoName) conformToAGL(newFont, self.adobeGlyphList) otfName = self.generateOutputPath(f, "otf") - saveOTF(newFont, otfName, checkOutlines=self.checkOTFOutlines, - autohint=self.autohintOTF) + saveOTF(newFont, otfName, autohint=self.autohintOTF) - if self.buildTTF: - log(">> Generating TTF file") + if self.checkOTFOutlines or self.buildTTF: import fontforge - ttfName = self.generateOutputPath(f, "ttf") otFont = fontforge.open(otfName) - otFont.generate(ttfName) + + if self.checkOTFOutlines: + for glyphName in otFont: + otFont[glyphName].removeOverlap() + otFont.generate(otfName) + + if self.buildTTF: + log(">> Generating TTF file") + otFont.generate(self.generateOutputPath(f, "ttf")) if self.buildFEA: log(">> Generating FEA files") -- cgit v1.2.3