Created
February 15, 2017 11:00
-
-
Save iSWORD/a849b7c7ec6a57d4789f87c3c34d262f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python2 | |
import sys, fontforge, string | |
allowed_chars = string.printable # ascii (32 -> 126) | |
if len(sys.argv) == 3: | |
font = fontforge.open(sys.argv[1]) | |
for char in allowed_chars.decode("UTF-8"): | |
font.selection[ord(char)] = True | |
font.selection.invert() | |
for glyph in font.selection.byGlyphs: | |
font.removeGlyph(glyph) | |
font.generate(sys.argv[2]) | |
else: | |
print "Usage: {} [input.ttf] [output.ttf]".format(sys.argv[0]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment