[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] [announcement] SFont 0.1 for pygame



On May 1, 2004, at 11:02 PM, Eric Burgess wrote:

Download it from here: http://big-brain.org/files/python/pygame/

I've created a small module that allows the use of SFont bitmapped fonts with pygame. The SFont format makes it simple to use proportional-width bitmapped fonts. More information on SFont can be found at http://www.linux-games.com/sfont/
sfont looks very promising, but I get the following error at run-time:

File "spinvaders.py", line 707, in __init__
self.specialScoreFont = sfont.Font('data/arial_12_mac_chrome_0.png')
File "/Users/jnutting/projects/spinvaders/sfont.py", line 29, in __init__
self._load_characters(filename, firstchar)
File "/Users/jnutting/projects/spinvaders/sfont.py", line 56, in _load_characters
ch = unichr(ord(ch)+1)
ValueError: unichr() arg not in range(0x10000) (narrow Python build)

So I tried to see what "ch" was by putting a print before line 56 and got this:

File "/Users/jnutting/projects/spinvaders/sfont.py", line 56, in _load_characters
print "ch : " + ch
UnicodeEncodeError: 'ascii' codec can't encode character '\u80' in position 5: ordinal not in range(128)

Maybe I'm just missing something obvious...

BTW, this is on Mac OS X 10.3 with included python 2.3.

//jack