[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[pygame] Tentative patch for "metrics" font method
- To: pygame-users@xxxxxxxx
- Subject: [pygame] Tentative patch for "metrics" font method
- From: "Guillaume Proux" <gproux@xxxxxxxxx>
- Date: Fri, 19 Jan 2007 02:57:03 +0900
- Delivered-to: archiver@seul.org
- Delivered-to: pygame-users-outgoing@seul.org
- Delivered-to: pygame-users@seul.org
- Delivery-date: Thu, 18 Jan 2007 12:57:29 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:mime-version:content-type; b=JiRr4MtvAvHFDzW+5cf+rUgGNATYe8aJNJ+TTRrbnV7M8Dl5h0RNoZIzOuFa8sUWll5yTROOcKahPrCpVm2wiaB46EYswWZ1IM+AjYtFiDmgF3TUapnhX4A7FEO9VGk/RJ6qAuNN/h3r6eR/q0XbGNSmaw6a4/etuajVc8YJUok=
- Reply-to: pygame-users@xxxxxxxx
- Sender: owner-pygame-users@xxxxxxxx
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