From ee1d12f1819432c933ada834acd5ddadd0a1aaa1 Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Mon, 2 Mar 2015 12:07:00 -0800 Subject: Further simplify OTF generation. The issue with glyph order in ufo2fdk has been fixed, so we no longer need our own partsCompiler subclass. --- scripts/lib/fontbuild/saveOTF.py | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'scripts') diff --git a/scripts/lib/fontbuild/saveOTF.py b/scripts/lib/fontbuild/saveOTF.py index bb54622..51c3c61 100644 --- a/scripts/lib/fontbuild/saveOTF.py +++ b/scripts/lib/fontbuild/saveOTF.py @@ -1,34 +1,11 @@ from ufo2fdk import OTFCompiler -from ufo2fdk.makeotfParts import MakeOTFPartsCompiler def saveOTF(font, destFile, autohint=False): """Save a RoboFab font as an OTF binary using ufo2fdk.""" - compiler = OTFCompiler(partsCompilerClass=_PartsCompilerCustomGlyphOrder) + compiler = OTFCompiler() reports = compiler.compile(font, destFile, autohint=autohint) if autohint: print reports["autohint"] print reports["makeotf"] - - -class _PartsCompilerCustomGlyphOrder(MakeOTFPartsCompiler): - """OTF parts compiler that produces a custom glyph order file.""" - - def setupFile_glyphOrder(self, path): - # fixes: https://github.com/typesupply/ufo2fdk/pull/3 - lines = [] - for name in self.glyphOrder: - if name in self.font and self.font[name].unicode is not None: - code = "%04X" % self.font[name].unicode - if len(code) <= 4: - code = "uni%s" % code - else: - code = "u%s" % code - line = "%s %s %s" % (name, name, code) - else: - line = "%s %s" % (name, name) - lines.append(line) - ofile = open(path, "wb") - ofile.write("\n".join(lines) + "\n") - ofile.close() -- cgit v1.2.3