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

Re: [pygame] freetype module



On, Fri Jan 14, 2011, Lenard Lindstrom wrote:

> 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. 

The bug can be solved by storing the relative text bbox width and
height.

> This can cause a Python interpreter crash.

I did not encounter that so far. Can you provide an example for that?
 
> 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?

Pulling in pango means pulling in Glib20 and friends. Personally I would
not recommend that.
 
Regards
Marcus

Attachment: pgpYLrD1uFDHQ.pgp
Description: PGP signature