setGlyphOrder.py 319 B

1234567891011121314151617
  1. from defcon.objects.font import Font
  2. import os
  3. glyphOrder = []
  4. with open("glyphorder.txt", "r") as f:
  5. glyphOrder = f.read().splitlines()
  6. DIR = "master_ufo"
  7. for fn in os.listdir(DIR):
  8. if fn.endswith(".ufo"):
  9. font = Font(os.path.join(DIR, fn))
  10. font.glyphOrder = glyphOrder
  11. font.save()
  12. print fn
  13. print "Done"