diff options
author | James Godfrey-Kittle <jamesgk@google.com> | 2015-02-10 16:15:36 -0800 |
---|---|---|
committer | James Godfrey-Kittle <jamesgk@google.com> | 2015-04-16 12:16:29 -0700 |
commit | 60d5644c64b0be1af7ecefcf0e644d4e5691a694 (patch) | |
tree | a5d3b5baab11f07a1287ab95d9cbd1685508bba3 /scripts/lib/fontbuild/mkmkFeature.py | |
parent | 44f5079ba84bf30aa4072f877687b188e06ee8ce (diff) |
More robust feature support.
Diffstat (limited to 'scripts/lib/fontbuild/mkmkFeature.py')
-rwxr-xr-x | scripts/lib/fontbuild/mkmkFeature.py | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/scripts/lib/fontbuild/mkmkFeature.py b/scripts/lib/fontbuild/mkmkFeature.py index cfc722e..e2195f5 100755 --- a/scripts/lib/fontbuild/mkmkFeature.py +++ b/scripts/lib/fontbuild/mkmkFeature.py @@ -1,6 +1,6 @@ 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)
@@ -8,7 +8,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:
@@ -19,7 +19,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:
for anchor in g.anchors:
if anchor_name == anchor.name:
g_list.append([g.name, anchor.x, anchor.y])
@@ -55,13 +55,7 @@ def GenerateFeature_mkmk(font): text += Create_mkmk1(accent_mark_list, base_mark_list, "mkmk1")
text += "} mkmk;\n"
- mkmk = Feature("mkmk", text)
- not_exist = True
- for n in range(len(font.features)):
- if ('mkmk' == font.features[n].tag):
- font.features[n] = mkmk
- not_exist = False
-
- if (not_exist):
- font.features.append(mkmk)
+ if "mkmk" not in font.features.tags:
+ font.features.tags.append("mkmk")
+ font.features.values["mkmk"] = text
|