Skip to content

Commit

Permalink
chore: sort glyph groups
Browse files Browse the repository at this point in the history
  • Loading branch information
mishamyrt committed Sep 25, 2024
1 parent 338d72c commit b684cb1
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions scripts/porting.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@
ROMAN_FONT_PATH = "sources/Lilex.glyphs"
ITALIC_FONT_PATH = "sources/Lilex-Italic.glyphs"

GLYPH_GROUPS = {
"Ligatures": ".liga",
"Sequences": ".seq",
"Spacers": ".spacer",
"Bulgarian forms": ".loclBGR",
}
GLYPH_GROUPS = [
("Ligatures", ".liga"),
("Sequences", ".seq"),
("Bulgarian forms", ".loclBGR"),
("Miscellaneous", None),
("Spacers", ".spacer"),
]


global_args(
Expand Down Expand Up @@ -48,16 +49,15 @@ def progress(args):
"Miscellaneous": [],
}
for glyph in stored_glyphs:
group_added = False
for group, suffix in GLYPH_GROUPS.items():
if suffix in glyph:
for group, suffix in GLYPH_GROUPS:
if suffix is None:
groups[group].append(glyph)
continue
elif suffix in glyph:
if group not in groups:
groups[group] = []
groups[group].append(glyph)
group_added = True
break
if not group_added:
groups["Miscellaneous"].append(glyph)


print("## Glyphs porting progress")
Expand All @@ -68,7 +68,8 @@ def progress(args):
print("<summary>Glyphs status</summary>")
print()

for group, glyphs in groups.items():
for group, _ in GLYPH_GROUPS:
glyphs = groups[group]
print(f"### {group}")
print()
for glyph in glyphs:
Expand Down

0 comments on commit b684cb1

Please sign in to comment.