Writes the given text into the image using TrueType fonts.
PHP imagettftext() function has the following syntax.
array imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
<?php// ww w .j av a 2 s . c o m
$image = imagecreate(400,300);
$blue = imagecolorallocate($image, 0, 0, 255);
$white = ImageColorAllocate($image, 255,255,255);
imagettftext($image, 44, 15, 50, 200, $white,"ARIAL", "java2s.com");
// Set the content-type
header("content-type: image/png");
imagepng($image);
imagedestroy($image);
?>