summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/generateGlyph.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-06-17 12:50:00 -0700
committerJames Godfrey-Kittle <jamesgk@google.com>2015-06-17 14:12:56 -0700
commita24427937cfbec87c458b397ed5982bf534479f1 (patch)
tree3c2d3678b61d3fa7b218fb2385ed1bde02780868 /scripts/lib/fontbuild/generateGlyph.py
parent84ec6e99fe55ac40f4ca7824aceea3d4105a84bc (diff)
parentf0446ecc7eee2fe55e4f81563e035f8bee01b748 (diff)
Merge branch 'delivery-script-updates' into delivery-updates
Diffstat (limited to 'scripts/lib/fontbuild/generateGlyph.py')
-rw-r--r--scripts/lib/fontbuild/generateGlyph.py57
1 files changed, 51 insertions, 6 deletions
diff --git a/scripts/lib/fontbuild/generateGlyph.py b/scripts/lib/fontbuild/generateGlyph.py
index c674c38..4079046 100644
--- a/scripts/lib/fontbuild/generateGlyph.py
+++ b/scripts/lib/fontbuild/generateGlyph.py
@@ -15,7 +15,7 @@
import re
from anchors import alignComponentsToAnchors
-
+from string import find
def parseComposite(composite):
c = composite.split("=")
@@ -33,6 +33,7 @@ def parseComposite(composite):
def copyMarkAnchors(f, g, srcname, width):
+ unicode_range = range(0x0030, 0x02B0) + range(0x1E00, 0x1EFF)
anchors = f[srcname].anchors
for anchor in anchors:
if "top_dd" == anchor.name:
@@ -43,19 +44,63 @@ def copyMarkAnchors(f, g, srcname, width):
g.appendAnchor(anchor.name, (anchor.x + width, anchor.y))
if "top" == anchor.name:
if g.unicode == None:
- continue
- if g.unicode > 0x02B0:
- continue
+ if -1 == find(g.name, ".ccmp"):
+ continue
+ if False == (g.unicode in unicode_range):
+ if -1 == find(g.name, ".ccmp"):
+ continue
+ #if g.unicode > 0x02B0:
+ # continue
parenttop_present = 0
for anc in g.anchors:
if anc.name == "parent_top":
parenttop_present = 1
- if parenttop_present:
+ if 0 == parenttop_present:
+ g.appendAnchor("parent_top", anchor.position)
+
+ if "bottom" == anchor.name:
+ if g.unicode == None:
continue
- g.appendAnchor("parent_top", anchor.position)
+ if False == (g.unicode in unicode_range):
+ continue
+ #if g.unicode > 0x02B0:
+ # continue
+ bottom_present = 0
+ for anc in g.anchors:
+ if anc.name == "bottom":
+ bottom_present = 1
+ if 0 == bottom_present:
+ anchor2 = Anchor(anchor)
+ anchor2.name = "bottom"
+# anchor1.x += width
+ g.anchors.append(anchor2)
+
+# anchor1 = Anchor(anchor)
+# anchor1.name = "top"
+# anchor1.x += width
+# g.anchors.append(anchor1)
+
# if "rhotichook" == anchor.name:
# g.appendAnchor(anchor.name, (anchor.x + width, anchor.y))
+
+ #print g.anchors
+ for anchor in g.anchors:
+ if "top" == anchor.name:
+ #print g.name, g.anchors
+ return
+
+ anchor_parent_top = None
+
+ for anchor in g.anchors:
+ if "parent_top" == anchor.name:
+ anchor_parent_top = anchor
+ break
+
+ if anchor_parent_top:
+ anchor_top = Anchor(anchor_parent_top)
+ anchor_top.name = "top"
+ g.anchors.append(anchor_top)
def generateGlyph(f,gname,glyphList={}):