testo_img.php
Codice PHP:
<?php
// Carattere che vuoi utilizzare, deve essere uppato in remoto
$font = $_SERVER['DOCUMENT_ROOT'] . "/fonts/ARIAL.TTF";
$testo = strtoupper ( trim ($_GET['t']) );
// Dimensione del testo
$size = 10;
$dim = imagettfbbox($size, 0, $font, $testo);
$w = $dim[2] + 5;
$h = - $dim[5] + 2;
header("Content-type: image/jpeg");
$im = imagecreate($w, $h);
$sfondo = imagecolorallocate($im, 255, 255, 255);
$colore = imagecolorallocate($im, 0, 0, 0);
imagettftext($im, $size, 0, 2, $h - 2, $colore, $font, $testo);
imagejpeg($im,"",100);
imagedestroy($im);
?>
e lo richiami come
Codice PHP:
[img]testo_img.php?t=Testo che vuoi visualizzare[/img]
Oppure c'è anche http://it.php.net/manual/it/function.imagestring.php che però non ha la gestione del font