note 101684 added to function.imagettfbbox
| From: | AndreyZakharov at osu1 dot php dot net | Date: | Tue, 04 Jan 2011 23:16:57 +0000 |
| Subject: | note 101684 added to function.imagettfbbox | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-175451@lists.php.net to get a copy of this message | ||
For mixed text drawing on image, height given by this function is useless and leads to text's
hip-hops over the baseline .
I will use just this:
<?php
$size = 12;//font height
$font = 'Arial';// your font
$char = 'Test';
$char = 'With W';
$char = 'without w but with p and y and q';
$rect = imagettfbbox($size, 0, $font, $char);
$image_height =abs( $rect[7] );//do no respect bottom margin
$imw = $rect[2] - $rect[0]; //as usual
$bx = abs( $rect[ 0 ] ); // X offset
$by = $size * 1.25; // Y offset - we will use const LINEHEIGHT
?>
----
Server IP: 69.147.83.197
Probable Submitter: 88.201.182.250
----
Manual Page -- http://www.php.net/manual/en/function.imagettfbbox.php
Edit -- https://master.php.net/note/edit/101684
Del: integrated -- https://master.php.net/note/delete/101684/integrated
Del: useless -- https://master.php.net/note/delete/101684/useless
Del: bad code -- https://master.php.net/note/delete/101684/bad+code
Del: spam -- https://master.php.net/note/delete/101684/spam
Del: non-english -- https://master.php.net/note/delete/101684/non-english
Del: in docs -- https://master.php.net/note/delete/101684/in+docs
Del: other reasons-- https://master.php.net/note/delete/101684
Reject -- https://master.php.net/note/reject/101684
Search -- https://master.php.net/manage/user-notes.php