note 60161 added to function.imageftbbox
| From: | theove at osu1 dot php dot net | Date: | Wed, 28 Dec 2005 14:20:55 +0000 |
| Subject: | note 60161 added to function.imageftbbox | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-100849@lists.php.net to get a copy of this message | ||
IF we accept the idea that a bouding box is returned then:
$bbox= imageftbbox ( $size, $angle, $font, $txt);
$width = abs($bbox[4] - $bbox[0]);
$height = abs($bbox[1] - $bbox[5]);
may be a better kind of math. But it depends... You may want to subtract yet another '1'
from both the width and the height.
But try drawing a "p" and next try a "d". Their bounding boxes differ 1 px in
height. Of course the respective boxes, by imagefttext(), are placed at a different y coordinate. I
noticed that if a "p" or a "b" is drawn at (0, 30) the first character of the
string actually starts on, fills, the third horizontal pixel. Also: if your image is only 30 pixels
in heigth, drawing text at (0, 30) means that the bottoms parts of "p", "q",
"y" and alike are somewhere else...
----
Manual Page -- http://www.php.net/manual/en/function.imageftbbox.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+60161
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+60161&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+60161&report=yes
Search -- http://master.php.net/manage/user-notes.php