note 87173 added to function.imagettfbbox
| From: | pavan dot solapure at gmail dot com | Date: | Sat, 22 Nov 2008 15:33:44 +0000 |
| Subject: | note 87173 added to function.imagettfbbox | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146830@lists.php.net to get a copy of this message | ||
Can we calculate character length in pixels as follows -
$font = 'verdana.ttf';
$lenghts = array();
for($i=32;$i<=255;$i++)
{
$letter = chr($i);
$ordinates = imagettfbbox ("11", 0, $font, $letter);
$lenghts[$letter] = $ordinates[2]-$ordinates[0];
}
Output >>
Array
(
[ ] => 5
[0] => 8
.
.
.
[9] => 8
[A] => 13
[B] => 8
.
.
.
[Y] => 9
[Z] => 8
.
.
[a] => 7
[b] => 7
.
.
[y] => 9
[z] => 7
)
----
Server IP: 203.199.69.133
Probable Submitter: 121.247.78.21
----
Manual Page -- http://www.php.net/manual/en/function.imagettfbbox.php
Edit -- https://master.php.net/note/edit/87173
Del: integrated -- https://master.php.net/note/delete/87173/integrated
Del: useless -- https://master.php.net/note/delete/87173/useless
Del: bad code -- https://master.php.net/note/delete/87173/bad+code
Del: spam -- https://master.php.net/note/delete/87173/spam
Del: non-english -- https://master.php.net/note/delete/87173/non-english
Del: in docs -- https://master.php.net/note/delete/87173/in+docs
Del: other reasons-- https://master.php.net/note/delete/87173
Reject -- https://master.php.net/note/reject/87173
Search -- https://master.php.net/manage/user-notes.php