summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/fonts/punknova/tools
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2011-11-25 00:09:14 +0000
committerKarl Berry <karl@freefriends.org>2011-11-25 00:09:14 +0000
commitafa0c1517d983115db76442c8f7a9c3a99e3bace (patch)
tree32820342ae8dd3bd8fe44aa6b511896160aa77e8 /Master/texmf-dist/doc/fonts/punknova/tools
parent5d144bfb5eea05c7ef74753153836d0b25b19874 (diff)
punknov 1.003 (23nov11)
git-svn-id: svn://tug.org/texlive/trunk@24649 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/fonts/punknova/tools')
-rw-r--r--Master/texmf-dist/doc/fonts/punknova/tools/build.py34
1 files changed, 19 insertions, 15 deletions
diff --git a/Master/texmf-dist/doc/fonts/punknova/tools/build.py b/Master/texmf-dist/doc/fonts/punknova/tools/build.py
index f2f1f681770..b98af0638e1 100644
--- a/Master/texmf-dist/doc/fonts/punknova/tools/build.py
+++ b/Master/texmf-dist/doc/fonts/punknova/tools/build.py
@@ -1,6 +1,7 @@
#!/usr/bin/python
-import os, sys
+import os
+import sys
import fontforge
import glob
import subprocess
@@ -165,20 +166,26 @@ def finalise(font):
space.width = 400
def usage():
- print "Usage: %s FONTFILE.mp [STYLE]" % sys.argv[0]
+ print "Usage: %s INFILE.mp OUTFILE.otf VERSION" % sys.argv[0]
if __name__ == "__main__":
- if len(sys.argv) < 2:
+ if len(sys.argv) < 3:
usage()
sys.exit()
- if len(sys.argv) >= 3:
- style = sys.argv[2].title()
- else:
- style = "Regular"
+ infile = sys.argv[1]
+ outfile = sys.argv[2]
+ version = sys.argv[3]
+
+ basefile = os.path.basename(infile)
+
+ style = basefile.split("-")[1]
+ style = os.path.splitext(style)[0].title()
+ if style == "Boldslanted":
+ style = "Bold Slanted"
tempdir = tempfile.mkdtemp()
- mpfile = os.path.abspath(sys.argv[1])
+ mpfile = os.path.abspath(infile)
instances = 32
font = fontforge.font()
@@ -192,16 +199,13 @@ if __name__ == "__main__":
font.familyname = "Punk Nova"
font.weight = style
- font.version = "001.002"
+ font.version = '00%.03f' %(float(version)/1000)
font.encoding = "Unicode"
- filename = "%s-%s.otf" %(font.familyname.replace(" ", "").lower(),
- style.replace(" ", "").lower())
-
font.copyright = "Unlimited copying and redistribution of this file are\
permitted as long as this file is not modified. Modifications are permitted,\
but only if the resulting file is not named '%s' and the (internal) fontname\
- differs from '%s'." % (filename, font.familyname)
+ differs from '%s'." % (outfile, font.familyname)
do_instances(font, instances, mpfile, tempdir)
add_gsub (font, instances)
@@ -212,6 +216,6 @@ if __name__ == "__main__":
sh.rmtree (tempdir)
- print "Saving file '%s'..." % filename
+ print "Saving file '%s'..." % outfile
# font.save()
- font.generate(filename)
+ font.generate(outfile)