bending text using imagick api
Posted: 2011-11-14T05:32:45-07:00
greetings everyone..
i have run into an issue with bending text using the imagick api. our server hosting team decided to block all shell commands which were being used earlier to execute commands in imagmagick. so i had to move on to the imagick api that is available for php. while i was able to find functions for almost every other command in imagemagick, this one, the one related to bending of texts eludes me.
i was using the distort arc method to accomplish text bending earlier
after looking up the list of functions available in imagick i found this one:-
the second parameter is supposed to be an array, but what values have to be passed to get the 90 degree bend, i am not sure. using the above code, the text does bend but at an awkward angle. can anyone point me in the right direction?
regards
i have run into an issue with bending text using the imagick api. our server hosting team decided to block all shell commands which were being used earlier to execute commands in imagmagick. so i had to move on to the imagick api that is available for php. while i was able to find functions for almost every other command in imagemagick, this one, the one related to bending of texts eludes me.
i was using the distort arc method to accomplish text bending earlier
Code: Select all
-distort Arc 90
Code: Select all
$image = new Imagick();
$draw = new ImagickDraw();
$pixel = new ImagickPixel('gray');
$image->newImage(1225, 1225, $pixel);
$image->setGravity(imagick::GRAVITY_CENTER);
$draw->setFont('arial');
$draw->setFillColor("#CCCCCC");
$draw->setFontSize(48);
$image->annotateImage($draw, 0, 48, 0, "HELLO WORLD");
$image->paintTransparentImage('gray', 0.0, 10);
$image->distortImage( Imagick::DISTORTION_ARC, array(90), true );
$image->trimImage(0);
$image->setImageFormat('png');
ob_start();
header("Content-type: image/png");
echo $image;
regards