Jump to content

Setting a font with GD?


phpcode

Recommended Posts

<?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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.