freetype
[Top][All Lists]
Advanced

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

Re: [ft] putting text in a box


From: Werner LEMBERG
Subject: Re: [ft] putting text in a box
Date: Thu, 21 Jan 2010 00:58:58 +0100 (CET)

>>> Do you know, though, of a way to get the descent value for an
>>> individual glyph reliably for any font?
>>
>> Normally, computing the cbox (or the bbox, to be absolutely sure
>> for the weird cases which shouldn't happen with well designed
>> fonts) should do the right thing.
> 
> I guess this is what's confusing me.  I looked at the tutorial code
> for getting the cbox, for example, and the result of the call is
> just that, a box.  So that would be a box which completely enclosed
> the glyph right?

Yes.

> How does that yield the information I need, namely the distance
> below the baseline which the glyph extends?

As I told you earlier: A negative bbox value descends below the
baseline (which has y=0).  I have no idea what's going on with GL.
There might be even a bug in FreeType, thus my request to test it with
native FreeType API calls.

A possible reason for GL to disallow negative bbox values is the
PostScript rendering model which by default cuts off all coordinates
with non-positive values (since they are drawn outside of the `drawing
paper' with its physical origin (0,0) at the lower left corner).


    Werner




reply via email to

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