Skip to content

Instantly share code, notes, and snippets.

@liamcurry
Created November 7, 2011 21:52
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 liamcurry/1346312 to your computer and use it in GitHub Desktop.
Save liamcurry/1346312 to your computer and use it in GitHub Desktop.
Converting fonts with fontforge and python
import fontforge
import os.path
filename = 'the-filename'
basename, ext = os.path.splitext(filename)
desired_formats = ['otf', 'eot']
font = fontforge.open(filename)
for desired_format in desired_formats:
font.generate('%s.%s' % (basename, desired_format))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment