fix-outline.py 346 B

1234567891011121314151617
  1. import os
  2. import fontforge
  3. file = sys.argv[1]
  4. font = fontforge.font()
  5. print (f"Correcting outline for {file}")
  6. glyph = font.createChar(123, file)
  7. glyph.importOutlines("./" + file)
  8. glyph.round()
  9. glyph.simplify()
  10. glyph.simplify()
  11. glyph.correctDirection()
  12. glyph.export("./" + file)
  13. glyph.clear()
  14. print ("Finished fixing svg outline directions!")