diff options
author | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-10 12:42:35 -0700 |
---|---|---|
committer | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-16 12:16:34 -0700 |
commit | 931ed8a2df0e790e980785d2e0da9a7de738c8ea (patch) | |
tree | 7c3824b9d78f3369d3bc2bc359fc02aa8f9da166 /scripts/lib/fontbuild/Build.py | |
parent | e6d114559a020a29e0f64cfd674de401609d7083 (diff) |
Update scripts to use external kerning rules.
Diffstat (limited to 'scripts/lib/fontbuild/Build.py')
-rw-r--r-- | scripts/lib/fontbuild/Build.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/lib/fontbuild/Build.py b/scripts/lib/fontbuild/Build.py index 0e1e35d..b7b3263 100644 --- a/scripts/lib/fontbuild/Build.py +++ b/scripts/lib/fontbuild/Build.py @@ -30,6 +30,7 @@ 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() + self.ot_kerningfeatures = self.basedir + "/" + self.config.get("res","ot_kerningfeaturesdir") adobeGlyphList = open(self.basedir + "/" + self.config.get("res", "agl_glyphlistfile")).readlines() self.adobeGlyphList = dict([line.split(";") for line in adobeGlyphList if not line.startswith("#")]) @@ -156,6 +157,14 @@ class FontProject: if kern: log(">> Generating kern classes") readFeatureFile(f, self.ot_kerningclasses) + weight = f.info.styleName.split()[0] + if weight in ["Light", "Italic"]: + weight = "Regular" + elif weight in ["Medium", "Black"]: + weight = "Bold" + feature_path = os.path.join( + self.ot_kerningfeatures, "Roboto-%s.fea" % weight) + readFeatureFile(f, open(feature_path).read(), prepend=False) log(">> Generating font files") GenerateFeature_mark(f) |