- <?
- if(!isset($_GET['text'])) $text = "y'a pas de texte !!!"; else $text = $_GET['text'];
- if(!isset($_GET['size'])) $s = 11; else $s = $_GET['size'];
-
- $font = "./vamp.ttf"; // a remplacer par votre police
- $size = imagettfbbox($s,0,$font,$text);
- $dx = abs($size[2]-$size[0]);
- $dy = abs($size[5]-$size[3]);
- $xpad=9;
- $ypad=9;
- $im = imagecreate($dx+$xpad,$dy+$ypad);
-
- $white = ImageColorAllocate($im, 255,255,255);
- $black = ImageColorAllocate($im, 0,0,0);
- ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $black, $font, $text);
-
- Header("Content-type: image/png");
- ImagePNG($im);
- ImageDestroy($im);
- ?>
<?
if(!isset($_GET['text'])) $text = "y'a pas de texte !!!"; else $text = $_GET['text'];
if(!isset($_GET['size'])) $s = 11; else $s = $_GET['size'];
$font = "./vamp.ttf"; // a remplacer par votre police
$size = imagettfbbox($s,0,$font,$text);
$dx = abs($size[2]-$size[0]);
$dy = abs($size[5]-$size[3]);
$xpad=9;
$ypad=9;
$im = imagecreate($dx+$xpad,$dy+$ypad);
$white = ImageColorAllocate($im, 255,255,255);
$black = ImageColorAllocate($im, 0,0,0);
ImageTTFText($im, $s, 0, (int)($xpad/2), $dy+(int)($ypad/2)-1, $black, $font, $text);
Header("Content-type: image/png");
ImagePNG($im);
ImageDestroy($im);
?>