[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Devel] Metric for hat (^) vertical offset? Solved!
From: |
Gustavo J. A. M. Carneiro |
Subject: |
Re: [Devel] Metric for hat (^) vertical offset? Solved! |
Date: |
Wed, 29 Oct 2003 11:56:58 +0000 |
A Qua, 2003-10-29 às 10:43, address@hidden escreveu:
> 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).
That's not a silly question at all! :)
I was indeed initializing to all zeroes, which is of course
incorrect. :P
I just changed to (+/-)MAXINT, plus some other changes elsewhere
derived from this one, and it works!!!
Many thanks! :-)
> 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
>
>
>
>
>
>
> _______________________________________________
> Devel mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/devel
--
Gustavo João Alves Marques Carneiro
<address@hidden> <address@hidden>
Re: [Devel] Metric for hat (^) vertical offset?, jonathan . foster, 2003/10/29
- Re: [Devel] Metric for hat (^) vertical offset? Solved!,
Gustavo J. A. M. Carneiro <=