freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Metric for hat (^) vertical offset?


From: jonathan . foster
Subject: Re: [Devel] Metric for hat (^) vertical offset?
Date: Wed, 29 Oct 2003 10:43:24 +0000

Hi,

"Gustavo J. A. M. Carneiro" <address@hidden> wrote:
>
>I am indeed calling FT_Glyph_Get_CBox.  Like this:
>
> memset(&cbox, 0, sizeof(cbox));
> FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_subpixels, &cbox);
> tl->cbox.xMin = MIN(tl->cbox.xMin, cbox.xMin);
> tl->cbox.yMin = MIN(tl->cbox.yMin, cbox.yMin);
> tl->cbox.xMax = MAX(tl->cbox.xMax, cbox.xMax);
> tl->cbox.yMax = MAX(tl->cbox.yMax, cbox.yMax);

Silly question: What are you initializing tl->cbox to?  It occurs
to me that the hat glyph might be entirely above y=0, but you might
be initializing tl->cbox.yMin and tl->cbox.yMax to 0.  You need to
initialize tl->cbox.yMin to MAX_INT, and tl->cbox.yMax to MIN_INT.
(Similarly for xMin & xMax).

Kind regards,

Jon Foster
--


"Gustavo J. A. M. Carneiro" <address@hidden> wrote:


A Ter, 2003-10-28 às 21:23, Werner LEMBERG escreveu:
> > The reason why layout is failing is that freetype indicates an
> > excessively large bounding box for the ^ glyph.
>
> What do you mean with `indicate'?  Normally, FreeType reports the
> metrics given in the font.  If you want an approximation to the
> smallest bounding box, you should call FT_Glyph_Get_CBox.

  I am indeed calling FT_Glyph_Get_CBox.  Like this:

             memset(&cbox, 0, sizeof(cbox));
             FT_Glyph_Get_CBox(glyph, ft_glyph_bbox_subpixels, &cbox);
             tl->cbox.xMin = MIN(tl->cbox.xMin, cbox.xMin);
             tl->cbox.yMin = MIN(tl->cbox.yMin, cbox.yMin);
             tl->cbox.xMax = MAX(tl->cbox.xMax, cbox.xMax);
             tl->cbox.yMax = MAX(tl->cbox.yMax, cbox.yMax);

This code is part of the text line layout loop.  It computes the union
of bounding boxes of all glyphs.  So, that's not it :-|

>
>
>     Werner
--
Gustavo J. A. M. Carneiro
<address@hidden> <address@hidden>


_______________________________________________
Devel mailing list
address@hidden
http://www.freetype.org/mailman/listinfo/devel








reply via email to

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