I have made this to display a txt file in a php generated image.
<?php
// shout sig
header("Content-type: image/png");
$file = array_reverse(file('shouts.txt'));
$im = @imagecreate(550, 120)
or die("Error! Could not create image stream.s");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 0, 255, 0);
$i = 1;
$j = 0;
foreach ($file as $line_num => $line) {
if($i <= count($file)-1)
imagestring($im, 2, 5, $j, substr($line, 0, strlen($line)-1), $text_color);
else
imagestring($im, 2, 5, $j, $line, $text_color);
$j+=15;
$i++;
}
imagepng($im);
imagedestroy($im);
?>
How can i change the font style of the text displayed?
I have a font as.ttf in the same dirrectory as this script.