QUOTE(electron @ Oct 24 2006, 04:22 AM)

Well i used that in my old server and it used to work.
Tap17 has a better version than that of my old server.
There is some error in your script.
Post it and we will find the error.
CODE
<?php
// Set the static variables (discussed in step 3)
$font_file = $_SERVER['DOCUMENT_ROOT']."/home/tehyev/public_html/fonts/Verdana.TTF";
$font_size = 8;
$y_start = 53;
$angle = 0;
$max_width = 300;
// Retrieve random fortune from text file (discussed in step 2)
$fortune_array = file("fortunes.txt");
srand((double) microtime() * 10000000);
$fortune = array_rand($fortune_array);
// Calculate horizontal starting point for the text (discussed in step 3)
$line_width = imagettfbbox($font_size, 0, $font_file, $fortune_array[$fortune]);
$x_start = (($max_width - $line_width[2] - $line_width[0]) / 2) + 50;
// Create the image resource and assign colors to variables (discussed in steps 1 and 5)
header("Content-type: image/png");
$im = imagecreatefrompng("blank.png");
$red = imagecolorallocate($im, 255, 0, 0);
// Write the text to the image (discussed in step 4)
imagettftext($im, $font_size, $angle, $x_start, $y_start, $red, $font_file, $fortune_array[$fortune]);
// Create and then destroy the image (discussed in steps 5 and 6)
imagepng($im);
imagedestroy($im);
?>
Theres the script.
Reply