PHP код:
<?
$width = 320;
$height = 240;
$text = "HELLO";
$size = 50;
$image = imagecreatetruecolor( $width, $height );
$font = "tahoma.ttf";
$bbox = imagettfbbox( $size, 0, $font, $text );
$black = imagecolorallocate( $image, 0, 0, 0 );
$white = imagecolorallocate( $image, 255, 255, 255 );
imagefilledrectangle( $image, 0, 0, $width, $height, $white );
imagettftext( $image, $size, 0, 0, $height/2, $black, $font, $text );
imagefilledrectangle( $image, 0, $bbox[1]+5+$height/2, $bbox[2], $bbox[3]+2+$height/2, $black );
header('Content-type: image/png');
imagepng( $image );
?>
Встроенной функции нет, если рисовать то сначала текст а потом линию подчеркивания