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

Re: [pygame] Tentative patch for "metrics" font method



A fixed up patch from Marcus was just committed.

Committed revision 987.


On 1/20/07, mva@xxxxxxxxxxxx <mva@xxxxxxxxxxxx> wrote:
Guillaume Proux <gproux@xxxxxxxxx>:

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

That's a nice method, but I recommend not to use it for getting actual glyph
metrics of a whole string. As it moves characters out of the context, the method
is unlikely to return the correct metrics for certain scripts like arabic, in
which
the rendered character metrics depends on the surrounding string context
(storage vs. represantation form).

Anyway, well done.

Regards
Marcus