summaryrefslogtreecommitdiff
path: root/scripts/lib
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-01-28 10:14:19 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:27 -0700
commite014eabf404f2d7789cb93e9208c9fdb2313b316 (patch)
tree2be64c6c010b4d922145d3447556579dbfe5d1b7 /scripts/lib
parent4ee04b9735ff0d252124816c3413d37eddf204fe (diff)
Handle composite glyph rules with underscores
Diffstat (limited to 'scripts/lib')
-rw-r--r--scripts/lib/fontbuild/generateGlyph.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/scripts/lib/fontbuild/generateGlyph.py b/scripts/lib/fontbuild/generateGlyph.py
index 2b29ada..4f9f026 100644
--- a/scripts/lib/fontbuild/generateGlyph.py
+++ b/scripts/lib/fontbuild/generateGlyph.py
@@ -17,18 +17,15 @@ def parseComposite(composite):
def generateGlyph(f,gname):
- if gname.find("_") != -1:
-
- #TODO(jamesgk@google.com) handle underscores
- return
-
- generateString = gname
- g = f.generateGlyph(generateString)
- if f.FindGlyph(g.name) == -1:
- f.glyphs.append(g)
- return g
+ glyphName, baseName, accentNames, offset = parseComposite(gname)
+ if baseName.find("_") != -1:
+ g = f.newGlyph(glyphName)
+ lastWidth = 0
+ for componentName in baseName.split("_"):
+ g.appendComponent(componentName, (lastWidth, 0))
+ lastWidth = f[componentName].width
+ g.width += lastWidth
else:
- glyphName, baseName, accentNames, offset = parseComposite(gname)
if not f.has_key(glyphName):
try:
f.compileGlyph(glyphName, baseName, accentNames)