<?php
function titulo($text, $id){

	$path="../netimages/titulo/";
	$imagem=$path . str_replace(" ", "_", $id) .".gif";	

	$fontsize = 15;
	$font = 'include/titulo/bma.ttf';
	$size = imagettfbbox($fontsize, 0, $font, $text);
	$width = $size[2] + $size[0] + 8;
	$height = abs($size[1]) + abs($size[7]);
	$im = imagecreate($width, $height);
	$colourBlack = imagecolorallocate($im, 255, 255, 255);
	imagecolortransparent($im, $colourBlack);
	$white = imagecolorallocate($im, 255, 255, 255);
	$black = imagecolorallocate($im, 63, 156, 65);
	imagefttext($im, $fontsize, 0, 0, abs($size[5]), $black, $font, $text);
	if (imagegif($im, $imagem)){
		imagedestroy($im);
		return "<img src=\"$imagem\" alt=\"$text\" border=\"0\">";
	}
	return "";
}
?>