From c112952f156b4ccb820568bca1fd1c59966f708e Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 4 Jul 2009 11:32:17 +0000 Subject: [PATCH] Add a size parameter to makefont.py --- makefont.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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]))) -- 2.45.2