[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [pygame] Segmentation Fault creating font
Pete Shinners wrote:
> Weber, Henrik wrote:
> > When I try to call the Font function with a parameter
> > different from None I get a segmentation fault like this:
> >
> >>>>import pygame
> >>>>pygame.font.init()
> >>>>f1 = pygame.font.Font(None, 14)
> >>>>f2 = pygame.font.Font("arial.ttf", 10)
> >
> > Pygame Parachute Traceback:
> > File "<stdin>", line 1, in ?
> > Fatal Python error: (pygame parachute) Segmentation Fault
>
> the problem is that Font will need a full path to the font file. it
> cannot find system fonts.
I thought I saw it crash with a full path yesterday as well. Probably I
misspelled the path
because I couldn't reproduce the crash today.
> but, it should not be throwing a segfault,
Yes. I would like a python exception much better too :-)
> i'll see if i can figure out why that is, but likely a
> foolish SDL_ttf
> thing. perhaps i can workaround it in pygame by first doing a
> 'isfile'
> test on the string?
>
> not too long ago we got some excellent code on the mailing list that
> does find the full paths to fonts on the system path. i'm
> still planning
> to roll this into pygame's font module.
Which saves me from asking that question ;-)