[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] freetype module
Hi everyone,
A few months back I had a look at the new freetype pygame module. It is
meant to replace the SDL_font based font module, and adds new features
such as text rotation and full Unicode character support. Unfortunately
it also has a serious bug in determining the text bounding rectangle
when the text contains a mix of character with ascenders and descenders.
This can cause a Python interpreter crash.
In the pygame freetype branch I added a method which correctly
calculates a bounding rect. But it uses a different approach than
pygame.freetype. The fix may require a significant rewrite. So it is
worthwhile to consider other possibilities. One would be to wrap pango,
then all formatting woes are taken care of. A pango for SDL library
already exits - http://sourceforge.net/projects/sdlpango - but nothing
has been done with it for over a year. I don't suggest using it
directly, but rather as a template for writing Pygame's own wrapper as
an extension module. Using pango is just an idea. It may turn out
building pango on Windows is too involved to be practical. Any thoughts?
In the mean time, the existing font module now renders UCS-2 (UTF-16
without surrogate pairs - no Egyptian Hieroglyphs, sorry) characters.
Lenard Lindstrom