summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/markFeature.py
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-02-10 16:15:36 -0800
committerJames Godfrey-Kittle <jamesgk@google.com>2015-04-16 12:16:29 -0700
commit60d5644c64b0be1af7ecefcf0e644d4e5691a694 (patch)
treea5d3b5baab11f07a1287ab95d9cbd1685508bba3 /scripts/lib/fontbuild/markFeature.py
parent44f5079ba84bf30aa4072f877687b188e06ee8ce (diff)
More robust feature support.
Diffstat (limited to 'scripts/lib/fontbuild/markFeature.py')
-rwxr-xr-xscripts/lib/fontbuild/markFeature.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/scripts/lib/fontbuild/markFeature.py b/scripts/lib/fontbuild/markFeature.py
index 4eb2b32..c966085 100755
--- a/scripts/lib/fontbuild/markFeature.py
+++ b/scripts/lib/fontbuild/markFeature.py
@@ -8,7 +8,7 @@ def GetAliaseName(gname):
def CreateAccNameList(font, acc_anchor_name):
lst = []
- for g in font.glyphs:
+ for g in font:
for anchor in g.anchors:
if acc_anchor_name == anchor.name:
lst.append(g.name)
@@ -16,7 +16,7 @@ def CreateAccNameList(font, acc_anchor_name):
def CreateAccGlyphList(font, acc_list, acc_anchor_name):
g_list = []
- for g in font.glyphs:
+ for g in font:
if g.name in acc_list:
for anchor in g.anchors:
if acc_anchor_name == anchor.name:
@@ -27,7 +27,7 @@ def CreateAccGlyphList(font, acc_list, acc_anchor_name):
def CreateGlyphList(font, acc_list, anchor_name):
g_list = []
- for g in font.glyphs:
+ for g in font:
if g.name in acc_list:
continue
for anchor in g.anchors:
@@ -77,15 +77,8 @@ def GenerateFeature_mark(font):
base_mark_list = CreateGlyphList(font, accent_name_list, anchor_name)
text += Create_mark_lookup(accent_mark_list, base_mark_list, "mark2", "@MC_bottom")
-
text += "} mark;\n"
- mark = Feature("mark", text)
-
- not_exist = True
- for n in range(len(font.features)):
- if ('mark' == font.features[n].tag):
- font.features[n] = mark
- not_exist = False
- if (not_exist):
- font.features.append(mark)
+ if "mark" not in font.features.tags:
+ font.features.tags.append("mark")
+ font.features.values["mark"] = text