Created
July 27, 2026 23:18
-
-
Save connordavenport/4f20097e5db9421e265d5790f1a884cc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import metricsMachine as mm | |
| import datetime | |
| import time | |
| import os | |
| ts = time.time() | |
| d = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m%d-%H%M%S') | |
| f = mm.CurrentFont() | |
| path = f.path.replace(os.path.splitext(f.path)[-1], f"-kern_{d}.fea") | |
| subs = False | |
| skip = f.lib.get("public.skipExportGlyphs", ()) | |
| pl = mm.GetPairList(f) | |
| s = set() | |
| for l,r in pl: | |
| s.add(l) | |
| s.add(r) | |
| s = list(s) | |
| ig = [g.name for g in f if g.name not in s or g.name in skip] | |
| f.lib["public.skipExportGlyphs"] = ig | |
| text = f.kerning.exportFeatureText(path,subs) | |
| f.lib["public.skipExportGlyphs"] = skip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment