-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nagi
authored and
nagi
committed
Sep 28, 2010
1 parent
0e2ce7e
commit f5b0b9d
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python | ||
# changes feature in the otf font! | ||
# arg1 => font | ||
# arg2 => feature_file | ||
|
||
import fontforge | ||
import sys | ||
|
||
TMP_FONT = "/tmp/temp.sfd" | ||
|
||
def main(): | ||
if len(sys.argv) != 3: | ||
usage() | ||
sys.exit(1) | ||
featureChange(sys.argv[1], sys.argv[2]) | ||
|
||
def featureChange(Font, Feature): | ||
font1 = fontforge.open(Font) | ||
font1.save(TMP_FONT) | ||
font = fontforge.open(TMP_FONT) | ||
for l in font.gsub_lookups: | ||
font.removeLookup(l) | ||
font.mergeFeature(Feature) | ||
font.generate('crazy_feature.ttf') | ||
|
||
def usage(): | ||
print "\nUSAGE: ", sys.argv[0], ' font_file feature_file\n' | ||
|
||
if __name__ == '__main__': | ||
main() |