(none) imager-devel
/ help / lists / applications / search /

Re: bounding boxes

From: Tony Cook (
Date: Thu 15 Aug 2002 - 12:03:54 UTC

  • Next message: Slaven Rezic: "Re: bounding boxes"

    On 14 Aug 2002, Slaven Rezic wrote:

    > is the output of the bounding_box method in Imager::Font correct? The
    > document states that the elements are: $neg_width, $global_descent,
    > $pos_width, $global_ascent, $descent, $ascent; but in tests I got
    > results like this (this should be a 24 point font): 1, -21, 135, 6,
    > -1, 18. $neg_width, $pos_width, $descent and $ascent look right, but
    > $global_descent and $global_ascent look wrong.

    I haven't had any problems with values from bounding_box(), except where
    the font had bad values.

    Of course that doesn't mean there aren't problems, but I'd want to see the
    font, your code, and know what text you were getting the bounding box for.

    > And a request: it seems that bounding_box does not honor the current
    > transformation. However, there is i_ft2_bbox_r() in the C code, which
    > returns the bounding box using the transformation. Could
    > bounding_box() be rewritten to use the current transformation?

    bounding_box() ignores the current tranformation because that would make
    the ascent and descent information less meaningful.

    It would be useful to expose the transformed box, but I think an extra
    function (or some option to bounding_box) would be better.