Skip to content

Instantly share code, notes, and snippets.

@ryanbugden
Created July 20, 2020 21:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanbugden/fafc973774496fdbfea46e92c3fbacc9 to your computer and use it in GitHub Desktop.
Save ryanbugden/fafc973774496fdbfea46e92c3fbacc9 to your computer and use it in GitHub Desktop.
Script that goes through each glyph in the current font and—based on its unicode—sets its name according to AGL
# menuTitle : Make All Glyph Names Human Readable
from lib.tools.unicodeTools import GN2UV
def get_key(val, di):
for key, value in di.items():
if val == value:
return key
f = CurrentFont()
for g in f:
if g.unicode in GN2UV.values():
g.name = str(get_key(g.unicode, GN2UV))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment