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: Dave Calkins
Subject: Re: [ft] putting text in a box
Date: Thu, 21 Jan 2010 11:29:01 -0500
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

For reference, a good link is also the below, scroll to the bottom which talks about positioning glyphs on a bitmap of specified size and it also mentions subtracting the lower left corner of the bounding box from the pen pos to get the actual glyph aligned with the box.

http://freetype.sourceforge.net/freetype2/docs/glyphs/glyphs-7.html

On 1/21/2010 10:12 AM, Dave Calkins wrote:
Thanks a ton for the help! Sure enough, my code was considering the overall size from the bbox (upper right - lower left) but I hadn't considered the fact that a negative lower left point was exactly the information I needed :) Live and learn!

I'm able to now subtract the lower left x and y from my pen position and the result is the text itself is "flush" against the desired position.


On 1/21/2010 2:42 AM, Werner LEMBERG wrote:
As I told you earlier: A negative bbox value descends below the
baseline (which has y=0).
How could a bounding box represent both the overall size of the
glyph and the descent at the same time?
Sorry for being imprecise.  A bbox consists of four values: The (x,y)
values of the lower left (llx,lly) and the upper right (urx,ury)
corner.  A box of a glyph with a descender looks like this:


                        (urx,ury)
            +----------+
            |          |
            |          |
            |          |
            |          |
      ------+----------+------  baseline (y = 0)
            |          |
            +----------+
   (llx,lly)


If I say `a negative bbox value' I've meant that lly<  0; the
descender is thus simply the value of lly.



_______________________________________________
Freetype mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/freetype






reply via email to

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