diff options
author | James Godfrey-Kittle <jamesgk@google.com> | 2015-02-04 16:43:21 -0800 |
---|---|---|
committer | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-16 12:16:28 -0700 |
commit | 3b5e819a1428c9a5525cb8ee5125f6d25638bd91 (patch) | |
tree | 7217efe827309b227e731ed2d1709cafd447dfa6 /scripts/lib/fontbuild/Build.py | |
parent | be9e3102a3be630e2593c594a64e598f00256548 (diff) |
Ensure font conforms to AGL before OTF conversion
Diffstat (limited to 'scripts/lib/fontbuild/Build.py')
-rw-r--r-- | scripts/lib/fontbuild/Build.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/scripts/lib/fontbuild/Build.py b/scripts/lib/fontbuild/Build.py index 94c2031..1646a8b 100644 --- a/scripts/lib/fontbuild/Build.py +++ b/scripts/lib/fontbuild/Build.py @@ -12,7 +12,7 @@ from fontbuild.markFeature import GenerateFeature_mark from fontbuild.mkmkFeature import GenerateFeature_mkmk from fontbuild.decomposeGlyph import decomposeGlyph from fontbuild.removeGlyphOverlap import removeGlyphOverlap -from fontbuild.saveOTF import saveOTF +from fontbuild.saveOTF import saveOTF, conformToAGL from fontbuild.sortGlyphs import sortGlyphsByUnicode import ConfigParser import os @@ -33,6 +33,8 @@ class FontProject: self.ot_classes = open(self.basedir + "/" + self.config.get("res","ot_classesfile")).read() self.ot_kerningclasses = open(self.basedir + "/" + self.config.get("res","ot_kerningclassesfile")).read() self.ot_features = open(self.basedir + "/" + self.config.get("res","ot_featuresfile")).read() + adobeGlyphList = open(self.basedir + "/" + self.config.get("res", "agl_glyphlistfile")).readlines() + self.adobeGlyphList = set([line.split(";")[0] for line in adobeGlyphList if not line.startswith("#")]) self.builddir = "out" self.decompose = self.config.get("glyphs","decompose").split() @@ -141,17 +143,18 @@ class FontProject: cleanCurves(f) deleteGlyphs(f, self.deleteList) -# if kern: -# log(">> Generating kern classes") -# generateFLKernClassesFromOTString(f, self.ot_kerningclasses) -# kern = f.MakeKernFeature() -# kern_exist = False -# for fea_id in range (len(f.features)): -# if "kern" == f.features[fea_id].tag: -# f.features[fea_id] = kern -# kern_exist = True -# if False == kern_exist: -# f.features.append(kern) + #TODO(jamesgk) create a system for generating RFont features and classes + #if kern: + # log(">> Generating kern classes") + # generateFLKernClassesFromOTString(f, self.ot_kerningclasses) + # kern = f.MakeKernFeature() + # kern_exist = False + # for fea_id in range (len(f.features)): + # if "kern" == f.features[fea_id].tag: + # f.features[fea_id] = kern + # kern_exist = True + # if False == kern_exist: + # f.features.append(kern) directoryName = n[0].replace(" ", "") fontName = "%s-%s" % (f.info.familyName.replace(" ", ""), @@ -167,6 +170,7 @@ class FontProject: if self.buildOTF: log(">> Generating OTF file") newFont = OpenFont(ufoName) + conformToAGL(newFont, self.adobeGlyphList) directoryPath = "%s/%s/%sOTF" % (self.basedir, self.builddir, directoryName) if not os.path.exists(directoryPath): |