Skip to content

Commit d2faf78

Browse files
committed
changing code lig names to make fea generator work
1 parent 0d9114f commit d2faf78

File tree

1,890 files changed

+28674
-2922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,890 files changed

+28674
-2922
lines changed
Binary file not shown.
Binary file not shown.

src/00-recursive-scripts-for-robofont/clean-up/rename-glyphs-select_fonts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
inputFonts = getFile("select masters to add feature code to", allowsMultipleSelection=True, fileTypes=["ufo"])
44

55
renames = {
6-
'Yhook': 'Yhookabove',
7-
'yhook': 'yhookabove',
8-
'yhook.italic': 'yhookabove.italic'
6+
'f_quote.code': 'f_quotesingle.code',
7+
'asterix_asterix_asterix.code': 'asterisk_asterisk_asterisk.code',
8+
'asterix_asterix.code': 'asterisk_asterisk.code'
99
}
1010

1111
for fontPath in inputFonts:

src/01-shell-scripts-for-sources/features/make-dlig-fea-code.py

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
"""
22
Build dlig feature code from "*.code" glyph names.
33
4+
Works best to run on a UFO in a varfontprep folder, so it doesn't generate code for nonexisting glyphs.
5+
46
USAGE:
57
68
python <path>/make-dlig-fea-code.py "<path>/<source-font>.ufo"
@@ -38,13 +40,12 @@ def makeDligBlock(ligName):
3840
if ".code" in g.name and "_" in g.name:
3941
codeLigs.append(g.name)
4042

41-
print(codeLigs)
42-
4343
font.close()
4444

45+
codeLigsSorted = sorted(codeLigs,key=lambda x: x.count('_'),reverse=True)
4546

4647
dligBlocks = ""
47-
for lig in codeLigs:
48+
for lig in codeLigsSorted:
4849
dligBlocks += makeDligBlock(lig) + "\n"
4950

5051
dligCode = f"""\
@@ -58,13 +59,4 @@ def makeDligBlock(ligName):
5859
with open(feaPath, "w") as f:
5960
f.write(dligCode)
6061

61-
62-
63-
print(dligCode)
64-
65-
66-
# lookup exclam_equal_equal {
67-
# ignore sub exclam exclam' equal' equal';
68-
# ignore sub exclam' equal' equal' equal;
69-
# sub exclam' equal' equal' by exclam_equal_equal.code;
70-
# } exclam_equal_equal;
62+
print(f"→ dligCode saved to {feaPath}")

0 commit comments

Comments
 (0)