Text Candy Helper python script for BMF and Glyph Designer

I have created a python script to export the characters strings from the .fnt files exported by Glyph Designer. This helps with the fact that AddCharsetFromBMF requires the characters in order they appear in the file and image.

save this script as fnt2lua.py and pass it the path to the exported font file as the first arg.

It will print out a nice string like this:
[lua]"|{}[)]($jQ%@OCGS/&U38bdg069?JWMAYXKVDRHNBZTPE5pq2kLFhf!Iily4#7t1;oecasm<>unrwxv+z:^*’=,~`.-_s"[/lua]

Which you can use in your code like this:
[lua]TextCandy.AddCharsetFromBMF(“hf”, “Helevetica_font.fnt”, "|{})[/lua]
usage:
python fnt2lua.py /mydir/foo/Helevetica_font.fnt
fnt2lua.py
[python]
print “Starting fnt2lua”

import sys

if (len(sys.argv) != 2):
print “no path given”
sys.exit()
else:
print sys.argv[1]

saveArray = []

f = open(sys.argv[1],‘r’)
for line in f.readlines():
nl = line.split(“letter=”)

if len(nl) == 2:
if “space” not in nl[1]:
nl = nl[1].replace(’\n’,’’)
saveArray.append(nl[1].replace(’"’,’’))

f.close()
print “Your Lua Table:”
print “”
print “”.join(saveArray)
print “”
print “”
[/python] [import]uid: 110373 topic_id: 24721 reply_id: 324721[/import]