freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] Determining the size of space character


From: Russell Shaw
Subject: Re: [ft-devel] Determining the size of space character
Date: Tue, 22 Aug 2006 23:39:43 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20060205 Debian/1.7.12-1.1

Ivan Tarapov wrote:
Russel,
I got freetype from CVS - there were some differences from the 2.2.1 version
I am using, but the problem with calculation of CBox for space character is
not fixed.

Basically the code is like this:

error = FT_Load_Glyph(face, curchar, FT_LOAD_DEFAULT);
.....
error = FT_Get_Glyph(face->glyph, &glyph);

the result is success for space character (curchar=3)

FT_Glyph_Transform(glyph, 0, &pos);

FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_pixels, &bbox);

From FT_Glyph_Get_CBox the function FT_Outline_Get_CBox( &glyph->outline,
bbox ); is called

Inside this function the check is made
if ( outline->n_points == 0 )

Naturally, the check fails for space char, because it doesn't have any
n_points as far as I recon. Maybe the routine for determining the size of
space character us different?

Hi,
The control-box probably isn't the right way to determine the glyph sizes.

I use face->size->metrics (FT_Size_Metrics) for scaleable fonts. I haven't got
around to working with bitmap fonts yet.

If you use FT_Glyph_Transform, hinting information is lost IIRC.




reply via email to

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