[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pygame] py2exe and fonts



> hello thomas. pygame programs can request a 'default font'
> by not specifying a path to the file. in that case the
> "font.pyd" module tries to load the "bluebold.ttf" font
> from the same directory as the font.pyd.
> 
> now how the module finds its own directory involves a little
> bit of mojo. it mainly just requires that "bluebold.ttf" lives
> in the same directory as "font.pyd". (actually, now that a look
> over the code, it needs to be in the same directory as 
> "pygame.__init__", which can get ugly when it is inside an exe)

Yes, I've also seen that by skimming over the code.
In the py2exe'd executable, PyModule_GetFileName (or how
it is called) does not contain a valid directory name.

> 
> a whole new idea just hit me, and it is all around better.
> i've checked it into cvs, and it should always find the default
> font when it is in the same directory as "font.pyd". (or
> "font.so" if that is your case :] )
Sounds better.

> thomas, this should work a lot better for you. as long as
> the bluebold.ttf is in the same directory as your font module,
> it should run, even in a standalone configuration.
> you can either update from cvs (instructions are here,
> http://www.pygame.org/info.shtml#cvs). or you can download the
> latest cvs snapshot, which is here,
> http://www.pygame.org/ftp/pygame-cvs.tar.gz
I've just retrieved font.c from the snapshot, rebuild,
and yup it works.

Thanks,

Thomas

____________________________________
pygame mailing list
pygame-users@seul.org
http://pygame.seul.org