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

Re: [pygame] font path



> Perhaps a full-fledged font-path is in order? 

i've never put too much thought into this. i just assumed
if a pygame game/app used its own fonts, it would just ship
with them.

the reason i haven't put any effort into using system fonts
is the 'name translation' problems. for example,
"new times roman" on windows means "helvetica" on unix. i
don't even know how this translates on mac.

an easy enough solution may be a function like

>>> pygame.font.find_system_font(['arial', 'helvetica'])

which would look for one of the given list of fonts
(in order). it would return the full pathname for the
font, returning None if not found.

this result could then be passed to the Font constructor
and things would work fine. (even if None was returned)
the biggest problem is this will require a little tuning
from people using each platform (macos, beos, etc). but
within a release or two it could be working very well?

would anyone be interested in this functionality? if so
would people from their respective platforms be willing to
contribute a little?

i'd like to have it done in a way that compiling pygame
still does not require any system headers/libs. that may
make things a little "tricky".


another interesting development with fonts is that freetype2
can load just about every font format on the planet (not just
TTF). so technically pygame.font should be able to work with
type-1 and opentype fonts. as well as bitmap formats like
FNT, SFNT, and PCF. i've currently found the SDL_ttf2 stuff
to be a little buggy since the 2.x releases, so i haven't
switched the windows binaries over yet. but soon there
could be support for a lot more formats. i'm not sure how
well these other formats will work through SDL though.




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