freetype
[Top][All Lists]
Advanced

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

Re: [Freetype] Bounding box


From: Olivier Couet
Subject: Re: [Freetype] Bounding box
Date: Tue, 24 Sep 2002 13:18:57 +0200 (CEST)

 Hello Laurent,

 I am not convince that gettting the max and min of all the glyphs in my
string will give me W and H as shown below, even after a rotation.

 Olivier

--
Org:    CERN - European Laboratory for Particle Physics.
Mail:   1211 Geneve 23 - Switzerland                                    
E-Mail: address@hidden                      Phone: +41 22 7676522
WWW:    http://cern.ch/Olivier.Couet/              Fax:   +41 22 7677155

On Tue, 24 Sep 2002, Laurent Lequenne wrote:

> Hello Olivier
> 
> >                +
> >              T |
> >            X   |
> >          E     |  H
> >        T       |
> >       +--------+
> >           W
> 
> For each glyph you get a bounding box, if you get the max and min of all
> boxes you obtain a final box that holds the complete string.  You do that
> once, you should just apply the transform of the box on that box too. In the
> ftstring.c example you can see they are using the bbox rectangle. I don't
> know anymore which function updates the bounding box a particular glyph.
> 
> You can also get the boxes each time you draw the string, the final best fit
> box will be the min. and max values of all boxes together.
> 
> The min and max values of the new box, will define the best fit box of your
> text, as each corner represents a limit of the box. Furthermore, If you are
> using outlines you need to take in count of the extra pixels needed to draw
> outside the borders.
> 
> Voila hope it answers your question =:)
> 
> Laurent
> 
> > What is the best way to get W and H for any font ?
> >
> >  Olivier
> >
> > --
> > Org:    CERN - European Laboratory for Particle Physics.
> > Mail:   1211 Geneve 23 - Switzerland
> > E-Mail: address@hidden                      Phone: +41 22 7676522
> > WWW:    http://cern.ch/Olivier.Couet/              Fax:   +41 22 7677155
> >
> >
> > _______________________________________________
> > Freetype mailing list
> > address@hidden
> > http://www.freetype.org/mailman/listinfo/freetype
> 
> 
> _______________________________________________
> Freetype mailing list
> address@hidden
> http://www.freetype.org/mailman/listinfo/freetype
> 




reply via email to

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