note 29237 added to function.imagepstext
| From: | Jeroen dot Straahof at newego dot nl | Date: | Fri, 07 Feb 2003 00:12:18 +0000 |
| Subject: | note 29237 added to function.imagepstext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-43536@lists.php.net to get a copy of this message | ||
I made a function that makes it easy to align text to the right
of an image. Below you can find the code because for me it
works great. You can also use it to center text as well, if you
like to have that simply remove the -10 and split the result
of $imgwidth and $texwidth
function AlignRight($string, $font, $imgwidth, $fontsize) {
list($lx,$ly,$rx,$ry) = imagepsbbox($string,$font,$fontsize,0,0,0);
$textwidth = $rx - $lx;
$imw = ($imgwidth-10-$textwidth);
return $imw;
}
--
http://www.php.net/manual/en/function.imagepstext.php
http://master.php.net/manage/user-notes.php?action=edit+29237
http://master.php.net/manage/user-notes.php?action=delete+29237
http://master.php.net/manage/user-notes.php?action=reject+29237