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 08:42:21 +0100 (CET)

>> 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.

> [...] let's say its height overall is 10 pixels (which completely
> encloses top-to-bottom the glyph) and the descent is 3 pixels.  How
> can both pieces of information be communicated through a box height?

Then you should have lly = -3 and ury = 7.

Hmm, I see that the description of FT_BBox doesn't mention the term
`baseline'.  I've improved it now hopefully by adding this:

  /* <Note>                                                                */
  /*    The bounding box is specified with the coordinates of the lower    */
  /*    left and the upper right corner.  In PostScript, those values are  */
  /*    often called (llx,lly) and (urx,ury), respectively.                */
  /*                                                                       */
  /*    If `yMin' is negative, this value gives the glyph's descender.     */
  /*    Otherwise, the glyph doesn't descend below the baseline.           */
  /*    Similarly, if `ymax' is positive, this value gives the glyph's     */
  /*    ascender.                                                          */


    Werner




reply via email to

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