-
Sorry for double post.
I have
PHP Code:
header("Content-type: image/gif");
$image = imagecreatefromgif( "christmas.gif" );
$font = 'comic.ttf'; // added the font to use (its in same directory)
$colour = imagecolorallocate($image, 0, 119, 180); //RGB colour, used for the text color
imagestring( $image, 50, 80, 20, $text, $colour ); //the image background, font size, width, height, text to echo, colour
imagegif( $image );
imagedestroy( $image );
But it doesn't seem to be displaying the text in the right font (comic.ttf) on the image...
-
Yeah, because imagestring doesn't have a font option :P You're really not plugging $font in anywhere..
Use imagettftext() instead of imagestring() ;)
-
Code:
[13-Nov-2008 22:07:02] PHP Warning: Wrong parameter count for imagettftext() in /home/prach/public_html/xmas/index.php on line 77
Line 77:
PHP Code:
imagettftext( $image, 50, 80, 20, $text, $colour ); //the image background, font size, width, height, text to echo, colour
-
You might want to look at this, http://uk2.php.net/manual/en/function.imagettftext.php , you should then be able to determine what parameters need to be set :)
-
See, look at the PHP.net documentation.. it tells you what you need to know: http://us3.php.net/imagettftext
imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
-
Thanks guys, got it working using the PHP pages ;) (My signature woop woop LOL)
+REP'd everyone I can.