summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-03-02 12:07:00 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:31 -0700
commitee1d12f1819432c933ada834acd5ddadd0a1aaa1 (patch)
tree08e927aecf2b3588f4ac5c20f137cd56d4787a21 /scripts
parent7651e368e4abbd33b43f82874b1f5433798e2171 (diff)
Further simplify OTF generation.
The issue with glyph order in ufo2fdk has been fixed, so we no longer need our own partsCompiler subclass.
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/fontbuild/saveOTF.py25
1 files changed, 1 insertions, 24 deletions
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()