Skip to content

Instantly share code, notes, and snippets.

@kaorimatz
Last active December 16, 2015 19:59
Show Gist options
  • Save kaorimatz/5489391 to your computer and use it in GitHub Desktop.
Save kaorimatz/5489391 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import sys
import fontforge
if __name__ == '__main__':
if len(sys.argv) != 5:
print 'usage: %s <input-font> <output-font> <hhead-ascent> <hhead-descent>' % sys.argv[0]
else:
font = fontforge.open(sys.argv[1])
font.hhea_ascent = int(sys.argv[3])
font.hhea_descent = int(sys.argv[4])
font.generate(sys.argv[2])
font.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment