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

[pygame] Font from file object crashes for me



Hey All,
using pygame 1.6 on python 2.3 on windows (cause I don't want to have
to distribute the ms cruntime) with SDL_ttf version 2.0.6 everytime I
try to load a font from a file object I get a pygame parachute
segfault

I'm attaching a test (modified from something on this list before)
that will load a font by name first, then if you press right arrow it
will load it from a file object.

Does this crash for other people when you press right arrow to load
from a file object? if so what version of pygame/python are you using
on what platform?

Does anybody have a sample that properly loads a font from a file
object on pygame 1.6? Is there anything wrong with the way this code
does it?

thanks!

p.s when I try to load a font from a file object with filemon logging
file activity, It seems no data reads from the font happen after the
file is first opened to get the file object, meaning sdl_ttf isn't
using the underlying file at all

this is the console output the test program gives me:
----------------------
['verasans.ttf', 'file:verasans.ttf']
pygame.font.Font(file, size) -> Font
create a new font object

This will create a new font object. The given file can
be a filename or any python file-like object.
The size represents the height of the font in
pixels. The file argument can be 'None', which will
use a plain default font.

You must have at least SDL_ttf-2.0.6 for file object
support. You can load TTF and FON fonts.

opening through file object: verasans.ttf
Pygame Parachute Traceback:
File "c:\temp\Font_Test.py", line 29, in DrawFont
Fatal Python error: (pygame parachute) Segmentation Fault

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Attachment: font_from_file_test.zip
Description: Zip archive