I have been doing some testing of Imagick for use on an upcoming project which is to be developed in PHP 5. So far Imagick has performed very well, but I am experiencing an issue which I do not know how to resolve. All functionality seems to work perfectly except ImagickDraw::setFont. In all tests I have been unable to alter the font used for any annotated text added to my image.
My sample code:
Code: Select all
$im = new Imagick('path-to/image/background.png');
$draw = new ImagickDraw();
$draw->setFont('arial.ttf'); /* .ttf file located in root directory with this script */
$draw->setFontSize(50);
$draw->setFillColor('#ec1010');
$draw->annotation(20, 50, "My test image text");
$im->drawImage($draw);
$im->borderImage( 'black', 1, 1 );
header("Content-type: ".$im->getFormat());
echo $im->getimageblob();
Imagick 6.3.7 has also been installed as one of the extras from the Zend yum repository.
All other features (that I have tested) work perfectly except the ability to alter the font used.
I have seen from other threads on this forum that reported a similar issue which required Imagick to be built from source to include freetype support. Before I re-install my server to try building this from source, can anyone tell me if they have had this working on a Zend repository install, or if there is something else which could be causing this?
Thanks in advance for any help.