Example #1
0
		$whitekey = imagecolorallocate($imkey,255,255,255);
		$blackkey = imagecolorallocate($imkey,0,0,0);

		$x = 3;
		#for($i=1; $i< 6; $i++)
		foreach ($map->fonts as $fontnumber => $font)
		{
			$string = "Abc123%";
			$keystring = "Font $fontnumber";
			list($width,$height) = $map->myimagestringsize($fontnumber,$string);
			list($kwidth,$kheight) = $map->myimagestringsize($keyfont,$keystring);
			
			if($kwidth > $width) $width = $kwidth;
			
			$y = ($sampleheight/2) + $height/2;
			$map->myimagestring($im, $fontnumber, $x, $y, $string, $black);
			$map->myimagestring($imkey, $keyfont,$x,$keyheight,"Font $fontnumber",$blackkey);
						
			$x = $x + $width + 6;
		}
		$im2 = imagecreate($x,$sampleheight + $keyheight);
		imagecopy($im2,$im, 0,0, 0,0, $x, $sampleheight);
		imagecopy($im2,$imkey, 0,$sampleheight, 0,0,  $x, $keyheight);
		imagedestroy($im);
		imagepng($im2);
		imagedestroy($im2);

		exit();        
		break;

	case 'draw':