This is not the exact source code of gif.php; some error checking has been
omitted.
Note that $fontfile is a file name, not a font name.
<?php
header("Content-type: image/gif");
$size=20;
if (isset($_REQUEST["size"])) $size=$_REQUEST["size"];
if (isset($_REQUEST["text"])) $text=$_REQUEST["text"];
$fontfile="Times";
$coords = imagettfbbox($size,0,$fontfile,$text) or die("");
$im = @imagecreate(($coords[2]-$coords[0])*1.02,($coords[1]-$coords[7])*1.02) or die("");
imagefill( $im, 0, 0, imagecolorallocate( $im, 255, 255, 255 ) );
imagettftext($im, $size, 0, 0, -$coords[7]*1.01,imagecolorallocate($im, 0,0,0),$fontfile,$text);
imagegif($im);
imagedestroy($im);
?>
Enjoy