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

Re: [pygame] Font height



On 5/9/06, Mike Wyatt <mwyatt@xxxxxxxxx> wrote:
Is there any way to manually adjust the height of a font rendered in
PyGame?  Ascent and descent are set to values that are quite a bit
larger than I would prefer, resulting in my text being drawn roughly 40%
lower than the given position.  There are no setters for those
attributes (only getters).  I could manually move the rendered text a
bit higher on the display, but that is a bit hacky and probably won't
work quite right for any given height value.

Thoughts?

My thought is that if you want the top of the character to be at a
particular place, you will have to adjust where you draw the font, but
I would guess you will be able to get a fairly simple formula to do
it. I don't really understand how freetype (and pygame font) figure
out how to render things as they do, but I'm very interested in
figuring out (hence my interest in a sample)