[Top][All Lists]

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

Re: [Freetype] Bounding box

From: Laurent Lequenne
Subject: Re: [Freetype] Bounding box
Date: Tue, 24 Sep 2002 12:03:50 +0200

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 =:)


> 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:              Fax:   +41 22 7677155
> _______________________________________________
> Freetype mailing list
> address@hidden

reply via email to

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