I have a script… it’s a simple script, that generates text on an image. I had someone help me center the text on the image. But it took out the font properties. Now it doesn’t show the font it’s supposed to. And I’m not too advanced with php, in fact I’m merely a beginner. And I’ll be the first to admit I’m not sure what to do. Can anyone tell me how to set a specific font on this?
Here’s the code, with the disabled lines that were originally on there.
[code]<?php
error_reporting(E_ALL ^ E_NOTICE);
session_start();
header(“Content-type: image/png”);
if ($_SESSION[“message”]){
$message = $_SESSION[“message”];
}else{
$message = $_GET[‘message’];}
$im = imagecreatefrompng(“Heart1.png”);
//$message_width = imagettfbbox(10, 0, “visitor.ttf”, $message);
//$message_start = (350 - ($message_width[2] + 123));
//$color = imagecolorallocate($im, 0, 0, 0);
//imagettftext($im, 10, 0, $message_start, 14, $color, “visitor.ttf”, $message);
$text_color = imagecolorallocate($im, 0, 0, 0);
$imgx = (imagesx($im) - 6.5 * strlen($message)) / 2;
$imgy = (imagesy($im)/6) ;
imagestring($im, 2, $imgx, $imgy, $message, $text_color);
imagepng($im);
imagedestroy($im);
?>
//Userbar Generator Script By Max Evans[/code]