note 42737 added to function.imageftbbox
| From: | groomed at users dot sf dot net | Date: | Thu, 27 May 2004 16:38:25 +0000 |
| Subject: | note 42737 added to function.imageftbbox | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-70192@lists.php.net to get a copy of this message | ||
ImageFTBBox returns a bounding box, not metrics, as some (most?) of the notes above seem to assume.
The 8 values it returns specify the 4 corners of this bounding box. So to properly determine the
width and height of a string you need to do:
$bbox = ImageFTBBox(...);
$width = abs($bbox[0]) + abs($bbox[2]); // distance from left to right
$height = abs($bbox[1]) + abs($bbox[5]); // distance from top to bottom
----
Manual Page -- http://www.php.net/manual/en/function.imageftbbox.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+42737
Delete -- http://master.php.net/manage/user-notes.php?action=delete+42737&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+42737&report=yes
Search -- http://master.php.net/manage/user-notes.php