summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/generateGlyph.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/fontbuild/generateGlyph.py')
-rw-r--r--scripts/lib/fontbuild/generateGlyph.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/lib/fontbuild/generateGlyph.py b/scripts/lib/fontbuild/generateGlyph.py
index 0bf25a1..4794fd8 100644
--- a/scripts/lib/fontbuild/generateGlyph.py
+++ b/scripts/lib/fontbuild/generateGlyph.py
@@ -16,13 +16,15 @@ def parseComposite(composite):
return (glyphName, baseName, accentNames, offset)
-def generateGlyph(f,gname):
+def generateGlyph(f,gname,glyphList={}):
glyphName, baseName, accentNames, offset = parseComposite(gname)
+
if baseName.find("_") != -1:
g = f.newGlyph(glyphName)
for componentName in baseName.split("_"):
g.appendComponent(componentName, (g.width, 0))
g.width += f[componentName].width
+
else:
if not f.has_key(glyphName):
try:
@@ -40,3 +42,7 @@ def generateGlyph(f,gname):
else:
print ("Existing glyph '%s' found in font, ignoring composition "
"rule '%s'" % (glyphName, gname))
+
+ # try to ensure every glyph has a unicode value -- used by FDK to make OTFs
+ if glyphName in glyphList:
+ f[glyphName].unicode = int(glyphList[glyphName], 16)