[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ft] lower positioned characters are cut with the example applicatio
Re: [ft] lower positioned characters are cut with the example application
Wed, 18 May 2011 15:49:55 +0300
On Wed, 2011-05-18 at 20:27 +0800, Vinayak SWARUP wrote:
> /* now, draw to our target surface (convert position) */
> draw_bitmap( &slot->bitmap,
> target_height - slot->bitmap_top );
This part is wrong. target_height is the canvas height, bitmap_top is
the distance between the baseline to the top of the glyph. You first
need to calculate the baseline, and then draw on
(baseline - bitmap_top).
Just choose a baseline and stick to it, aligning according to the top
pixel of the glyph is bad because everything will align to the top.
If you only want to draw one glyph, just do:
target_height - slot->bitmaps.rows which will render your glyph (and
stick it to the top), also, it looks like your HEIGHT is too small to
populate it so it'll get cut in the end anyway (counting the lines of
the output you gave us).
Bottom line: all the freetype calculations are done from origin, and
thus, you need to choose your origin before outputting anything.