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

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



Yes, the loop that counts up the characters is escaping. Was this with a font that you made? I had the same error yesterday with a self-made font, and the problem was that one of the characters in the font was too tall (it was the backtick character) and it interfered with the encoding of widths in the top row of the image.

Specifically, if there is any color other than magenta (255,0,255) or the background color in the top row, then this error will occur. Future versions will be better at handling that condition.

Thanks for the feedback!
-Eric

Jack Nutting wrote:

On May 4, 2004, at 12:13 PM, Niki Spahiev wrote:

try repr(ch)

Thanks, I had already figured out a way to see the value...

It looks like this loop cycles all the way up to 65535 (to potentially scan for all unicode character values I presume?) and then throws a ValueError instead of an IndexError (which is what the code checks for). If I modify the code to look for an ValueError instead it seems to work, although I just seem to be getting empty/black surfaces back from the render() function later on (which may be due to any oversight on my part; still investigating).

//jack