imagepstext
| From: | J.R. Carlson | Date: | Thu, 22 Mar 2001 19:04:57 +0000 |
| Subject: | imagepstext | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45167@lists.php.net to get a copy of this message | ||
I just upgraded to php4.0.4pl1( so I could use zend optimizer) with
t1lib.so.1, and I'm having some problems with t1lib work consistently.
What is happening is when I try to center certain text on a card size
image with a variable x coordinate, imagepstext will act as if $x =0. I
checked to see if my function was returning the correct number and it
is. This script has worked great with php3.0.12, and I even reinstalled
it to see if it still worked, and it did.
Here are the snippets from the script:
function getx($string,$font,$size){
$bbox = imagepsbbox($string, $font, $size);
$width = $bbox[2] - $bbox[0];
$x = 252 - ceil($width/2);
return $x;
}
$x = getx($name,$font1,18);
imagepstext($im, "$name", $font1, 18, $black, $white, $x, 45);
IF (for example)
$name = "Registered Representative" it will not center it (acts like
x=0, left justified)
$name = "Registered Representativ" it will not center it (acts like x=0,
left justified)
$name = "Registered Representati" it will center
$name = "Registered Repre5entative" it will center (char "5" can be any
letter but "s")
Any ideas? I would hate to have to go back to using ttf again.
Thanks,
JR