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? Quote 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() Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.