phpcode Posted August 14, 2007 Share Posted August 14, 2007 <?php header ("Content-type: image/Gif"); $back = imagecreatefromgif ("back.gif"); $textcolor = ImageColorAllocate ($back, 10, 10, 10); $font = "arial.tff"; $time = $date = date("H:i"); ImageString ($back, 10, 150, 100, "Last Refresh at: $time", $textcolor, $font); ImageGif ($back); ImageDestroy ($back); ?> I'm trying set a font but when I view it I get the error "The image at img.php cannot be displayed because it contains errors" Can anyone see anything wrong with the code? Link to comment https://forums.phpfreaks.com/topic/64879-setting-a-font-with-gd/ Share on other sites More sharing options...
Barand Posted August 14, 2007 Share Posted August 14, 2007 if you are using ttf fonts, use imagettftext() Link to comment https://forums.phpfreaks.com/topic/64879-setting-a-font-with-gd/#findComment-323850 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.