Created
February 10, 2012 06:18
-
-
Save skyisle/1787141 to your computer and use it in GitHub Desktop.
Copy font info
This file contains 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/python | |
import sys | |
import fontforge | |
if len(sys.argv) < 3: | |
print("Usage: %s <from> <to>" % sys.argv[0]) | |
sys.exit(1) | |
fromfile = sys.argv[1] | |
tofile = sys.argv[2] | |
fromfont = fontforge.open(fromfile) | |
tofont = fontforge.open(tofile) | |
print("fontname: " + fromfont.fontname); | |
print("familyname: " + fromfont.familyname); | |
print("fullname: " + fromfont.fullname); | |
fontname = fromfont.fontname | |
familyname = fromfont.familyname | |
fullname = fromfont.fullname | |
tofont.fontname = fontname | |
tofont.familyname = familyname | |
tofont.fullname = fullname | |
tofont.sfnt_names = fromfont.sfnt_names; | |
fromfont.close() | |
tofont.save() | |
tofont.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment