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: Ivan Tarapov
Subject: RE: [ft-devel] Determining the size of space character
Date: Tue, 22 Aug 2006 15:26:21 +0300

I tried with different .ttf fonts - tahoma, arial, comic, bold fonts - the
result was the same. When I try to call the code that measures the string
size, FT_Outline_Get_CBox returns zeroes for space character. Hence the
width of the string is calculated incorrectly - without taking spaces into
account.

Ivan

> -----Original Message-----
> From: Werner LEMBERG [mailto:address@hidden
> Sent: Tuesday, August 22, 2006 8:28 AM
> To: address@hidden
> Cc: address@hidden
> Subject: Re: [ft-devel] Determining the size of space character
> 
> 
> > I have been struggling for a long time to get it to determine the
> > size in pixels of the passed string correctly.
> >
> > Microwindows ultimately calls FT_Glyph_Get_CBox to determine the
> > CBox for the character and calculates its size accordingly. It
> > doesn't work for space character. The CBox for space character turns
> > out to be filled with zeroes, hence wrong pixelsize for the
> > string. FT_Glyph_Get_CBox in its turn calls ft_outline_glyph_bbox
> > which issues a call to FT_Outline_Get_CBox which does the
> > calculations.  However the calculations are based on the
> > outline->n_points field, which is zero for the space character. This
> > seems like a bug to me.  Or maybe there is a workaround for this?
> 
> Please give an example (say, with, verdana or tahoma) and describe
> what you expect.
> 
> 
>      Werner





reply via email to

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