Len Whistler
01-25-2007, 06:28 PM
I'm working on a php script that will put text onto images. I get the following error but I have the .ttf font file in the same folder as the script. Line 11 is the last line in the code I posted. Any ideas why I get the error?
Warning: imagettftext(): Could not find/open font in /home/httpd/vhosts/stubby.ca/httpdocs/test/index.php on line 11
<?php
$image = ImageCreateFromGIF("test.gif");
$color = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$colorShadow = imagecolorallocate($image, 0x66, 0x66, 0x66);
$font = 'LAPLDB.TTF';
$fontSize = "10";
$fontRotation = "0";
$str = "Copyright 2007");
/* Shadow */
ImageTTFText($image, $fontSize, $fontRotation, 7, 22, $colorShadow, $font, $str);
Warning: imagettftext(): Could not find/open font in /home/httpd/vhosts/stubby.ca/httpdocs/test/index.php on line 11
<?php
$image = ImageCreateFromGIF("test.gif");
$color = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
$colorShadow = imagecolorallocate($image, 0x66, 0x66, 0x66);
$font = 'LAPLDB.TTF';
$fontSize = "10";
$fontRotation = "0";
$str = "Copyright 2007");
/* Shadow */
ImageTTFText($image, $fontSize, $fontRotation, 7, 22, $colorShadow, $font, $str);