PHP GD font type change?

skinnypspplayer

New member
I have this:


<?
header ("Content-type: image/png");
$string = "my text goes here";
$font = 4;
$width = ImageFontWidth($font)* strlen($string) ;
$height = ImageFontHeight($font) ;

$im = ImageCreateFrompng("./gold.png");
$x=imagesx($im)-$width ;
$y=imagesy($im)-$height;
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 255, 255, 255);
imagestring ($im, $font, $x, $y, $string, $text_color);

imagepng ($im);
?>


It pretty much just puts text on an image but I need to know how to change the font for the text (like to Arial or something). I know there is something you can do but I can't find it. Any help?


PS: I think this is PHP GD or whatever. Sorry if I got it wrong
 
Back
Top