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

[pygame] Tentative patch for "metrics" font method



Hi,

I just started using Freevo (based on pygame) and I have some issues with fonts.
Apparently if one tries to render a string where not all chars are in
the font, there is no error and we get garbage out.

There is ONE function in SDL_TTF that can tell if a character is in
the font or not. This is GlyphMetrics. So I made a tentative patch (i
don't have a dev env ready therefore I haven't even compiled it so I
would appreciate if somebody could try it out) to add the metrics
method to fonts.

If a call to this method returns None, then it will mean that this
character cannot be rendered, which is what I will need in Freevo to
decide to switch to a different font.

Please let me know if this actually compiles and if it works!

Regards,

Guillaume

Attachment: pygame-metrics.patch
Description: Binary data