From: Mikko Rasa Date: Sat, 4 Jul 2009 11:32:17 +0000 (+0000) Subject: Add a size parameter to makefont.py X-Git-Tag: 1.1~6 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c112952f156b4ccb820568bca1fd1c59966f708e;p=libs%2Fgl.git Add a size parameter to makefont.py --- diff --git a/makefont.py b/makefont.py index ac816633..c61c1d5a 100755 --- a/makefont.py +++ b/makefont.py @@ -23,11 +23,11 @@ def convert_def(fn): return result -def make_font(fn): +def make_font(fn, size): import maketex import os - if os.system("ttf2png \"%s\" -o makefont-tmp.png -d makefont-tmp.def -t -p"%sys.argv[1]): + if os.system("ttf2png \"%s\" -o makefont-tmp.png -d makefont-tmp.def -t -p -s %d"%(fn, size)): raise Exception("Could not execute ttf2png") result="texture_inline\n{\n" @@ -43,8 +43,9 @@ def make_font(fn): if __name__=="__main__": import sys - if len(sys.argv)<3: - print "Usage: %s " + if len(sys.argv)<4: + import os + print "Usage: %s "%os.path.basename(sys.argv[0]) else: out=file(sys.argv[2], "w") - out.write(make_font(sys.argv[1])) + out.write(make_font(sys.argv[1], int(sys.argv[3])))