Problems with AddCharsetFromBMF

I’m not trying to do anything complex or fancy. I used BMFont by Angel code as specified in the TextCandy documentation.

I created a bitmap from a single letter, just to see if it would work after no success with an entire set, and it seems there may be an actual bug within the lib_text_candy file.

Here is the error read out:

lib_text_candy.lua:327: attempt to index field ’ ’ (a nil value)

That line is this:
[lua]AddCharset (name, Font.Sheet, Font.Sheet.file, charOrder, Font.chars[’ '].xadvance, 0, Font.info.lineHeight )[/lua]

I’m not sure exactly what the line does, or why there is an array index of ’ ', but wanted to point it out if it’s an error. If not, please let me know what I can do to get AddCharsetFromBMF working. [import]uid: 49447 topic_id: 23178 reply_id: 323178[/import]

Please send us your (stripped down) code, including all media files and we’ll investigate this issue. Also make sure you specified a correct charOrder string to load your BMFont -this string should include all chars found on the texture and in the order as they are placed on the texture (not in the data file). [import]uid: 10504 topic_id: 23178 reply_id: 93046[/import]

here you go:

http://db.tt/w8uepIlH

It’s as simplified as can be. For testing purposes, I created a font with just a single character (the upper case letter “A”) to demonstrate the error. [import]uid: 49447 topic_id: 23178 reply_id: 93075[/import]

Current Text Candy version requires a space character to be included in the provided BMFont which you did not provide with your font. We’ll make the space char optional with the next update, you’ll also be able to specify any number to be used for spacing then. [import]uid: 10504 topic_id: 23178 reply_id: 93303[/import]