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

Re: [pygame] Font-Related Segfault



The font in question is a custom font in a game data archive. I'm not
sure if by "load the font itself" you mean using sysfont to find it or
use pygame to open the ttf file, but it's impossible in either case,
unfortunately.
- Bryce

On Mon, Nov 23, 2009 at 12:43 PM, RB[0] <roebros@xxxxxxxxx> wrote:
> Why not just let Pygame load the font itself?
>
> On Mon, Nov 23, 2009 at 2:38 PM, Bryce Schroeder <bryce.schroeder@xxxxxxxxx>
> wrote:
>>
>> (My apologies if this is a double-post. I didn't get a copy of the
>> message or see it in the archive, so I'm trying again.)
>>
>>  I have a pygame program that worked in the past on both Linux and
>> Windows, but now results in a segfault, at least on Linux.  (I can't
>> test it on Windows.)
>> The segfault occurs in this code:
>>
>> class Font(Resource):
>>  ....
>>   def pygame_font(self,size):
>>       return pygame.font.Font(StringIO.StringIO(self.parts['font']),
>> size) # Segfaults here
>>
>>
>> self.parts['font'] is a string containing a truetype font loaded from
>> a file. I have checked that the string contains the file like it is
>> supposed too. Any suggestions?
>
>