[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Freetype] Font positioning problems

From: jay
Subject: [Freetype] Font positioning problems
Date: Thu, 12 Aug 2004 13:47:04 -0700

I've gotten freetype to render all alphanumeric and punctuation
characters to a bitmap texture, but they're not in the right
positions.  For instance, the period lies on the top of the rendered
bitmap instead of on the baseline where it should be.  Easy fix,

I'm using this to position the pen on the Y axis:
pen_y = ((face->size->metrics.advance >> 6)  -
face->glyph->bitmap_top) + rows * height;

rows is the number of complete rows of characters rendered to the bitmap texture
height is the max height of all glyphs in said face (18 in this specific case)

It works fine until it gets to character 40 ('(').  The above equasion
ends up evaluating to -1 making the renderer access memory out of
bounds and crash.  Specifically, the ascender / 64 is 13 and
bitmap_top is 14px.

Am I doing something wrong, or is the particular font I'm using
reporting incorrect metrics?

If you need any more information just let me know.  Thanks for any help!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]