Imagettftext无法正确显示文本

时间:2012-03-31 15:16:02

标签: php gd freetype freetype2

我正在为一个php应用程序使用pjp gd free类型库,imagefttext用于在运行时将一些文本放在图像上,它现在运行良好了一段时间,但我最近做了一些更改它在大多数图像上无法正常工作,但在正确显示的几张图像上,但所有图像都是相同类型(.gif)。

但在休息时它会显示非常不安的文字,如下所示: enter image description here

code:

$imageId = imagecreatefromgif($imageUrl);

        $angle = 0;
        $xCord = 4;
        $yCord = 40;
        $imageColor = imagecolorallocate($imageId, 222, 0, 84);
        $fontUrl = "./Verdana.ttf";
        $imageText = $firstName;
        $imageTextLnght = strlen($imageText);
        $fontSize = 25;
        $xCord = 4;
        imagefttext($imageId, $fontSize, $angle, $xCord, $yCord, $imageColor, $fontUrl, $imageText);
        $textImage = 'textImage.gif';
        imagegif($imageId, $textImage);
        imagedestroy($imageId);

请帮助我。

0 个答案:

没有答案
相关问题