Based on info found from several sources, i wrote this little script to write transparent images with a specific font:
Code: Select all
<?
header ("Content-type: image/png");
$Fuente = "english.ttf";
$r=255;
$g=153;
$b=255;
$Dimension = imageTTFBBox($Tamanio, 0, $Fuente, $Texto);
$Imagen = imageCreateTrueColor(abs($Dimension[2]) + abs($Dimension[0]), abs($Dimension[7]) + abs($Dimension[1]));
imageSaveAlpha($Imagen, true);
ImageAlphaBlending($Imagen, false);
$Transparencia = imagecolorallocatealpha($Imagen, $r, $g, $b, 127);
imagefill($Imagen, 0, 0, $Transparencia);
$Color = imagecolorallocate($Imagen, $r, $g, $b);
imagettftext($Imagen, $Tamanio, 0, 0, abs($Dimension[5]), $Color, $Fuente, $Texto);
imagepng($Imagen);
imagedestroy($Imagen);
?>http://roselly.destrella.com.mx/wp-cont ... qrstuvwxyz
but it should work like this (this sample is from the dafont.com website where i've downloaded the font):
http://img.dafont.com/preview.php?text= ... ize=m&y=54
(copy & paste the dafont.com link if doesnt work just clicking on it)
as you can see, both scripts works with the same font but something seems to be missing on mine; so the question here is, how to make it work properly? where is the mistake and how to solve it?
thanks in advance for your time and help