summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/Build.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-02-21 13:13:38 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:30 -0700
commit30193f337af2d2a1668658e2c5c456b1abd2586a (patch)
tree68e0840d6497d38989baac00f800f1407849610f /scripts/lib/fontbuild/Build.py
parenta9399ccfa784268eece38fa946bf9f531f2db306 (diff)
Set unicode values for generated glyphs.
This is necessary for the FDK to include these new glyphs in the output OTF's cmap.
Diffstat (limited to 'scripts/lib/fontbuild/Build.py')
-rw-r--r--scripts/lib/fontbuild/Build.py17
1 files changed, 12 insertions, 5 deletions
diff --git a/scripts/lib/fontbuild/Build.py b/scripts/lib/fontbuild/Build.py
index f96e487..3682e3d 100644
--- a/scripts/lib/fontbuild/Build.py
+++ b/scripts/lib/fontbuild/Build.py
@@ -32,9 +32,16 @@ class FontProject:
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(";")[1] for line in adobeGlyphList if not line.startswith("#")])
+ self.adobeGlyphList = dict([line.split(";") for line in adobeGlyphList if not line.startswith("#")])
- self.builddir = "out"
+ # map exceptional glyph names in Roboto to names in the AGL
+ roboNames = (
+ ('Obar', 'Ocenteredtilde'), ('obar', 'obarred'),
+ ('eturn', 'eturned'), ('Iota1', 'Iotaafrican'))
+ for roboName, aglName in roboNames:
+ self.adobeGlyphList[roboName] = self.adobeGlyphList[aglName]
+
+ self.builddir = "out/v2"
self.decompose = self.config.get("glyphs","decompose").split()
self.predecompose = self.config.get("glyphs","predecompose").split()
self.lessItalic = self.config.get("glyphs","lessitalic").split()
@@ -134,7 +141,7 @@ class FontProject:
decomposeGlyph(f[gname])
log(">> Generating glyphs")
- generateGlyphs(f, self.diacriticList)
+ generateGlyphs(f, self.diacriticList, self.adobeGlyphList)
log(">> Copying features")
readGlyphClasses(f, self.ot_classes)
readFeatureFile(f, self.basefont.features.text)
@@ -225,12 +232,12 @@ def log(msg):
print msg
-def generateGlyphs(f, glyphNames):
+def generateGlyphs(f, glyphNames, glyphList={}):
log(">> Generating diacritics")
glyphnames = [gname for gname in glyphNames if not gname.startswith("#") and gname != ""]
for glyphName in glyphNames:
- generateGlyph(f, glyphName)
+ generateGlyph(f, glyphName, glyphList)
def cleanCurves(f):
#TODO(jamesgk) remove calls to removeGlyphOverlap if we decide to use AFDKO