Re: Unable to get ImageTTFText output

From: Date: Tue, 05 Feb 2002 15:35:43 +0000
Subject: Re: Unable to get ImageTTFText output
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-83595@lists.php.net to get a copy of this message
Hi I had similar problems when just specifying the font file in the same directory eg ./arial.ttf but got it to work okay when i used the full path eg : $fontfile = "/apache/htdocs/arial.ttf"; ImageTTFText($im, 20, 0, 3, 3, $text_colour, $fontfile, "My text"); Regards Girish -- www.girishnath.co.uk ----- Original Message ----- From: "Neil Freeman" <neil.freeman@asa.co.uk> To: "PHP General" <php-general@lists.php.net> Sent: Tuesday, February 05, 2002 2:59 PM Subject: [PHP] Unable to get ImageTTFText output Hi there, I am trying to use the ImageTTFText function to output some text onto an existing image. Problem being though that the text does not get outputted. I have placed the ttf file 'arial.ttf' within the same directory as my script. Here is a snippet of my code: Header("Content-Type: image/png"); $im = ImageCreateFromPNG("original_image.png"); $text_colour = ImageColorAllocate($im, 255, 255, 255); ImageTTFText($im, 20, 0, 3, 3, $text_colour, "/arial.ttf", "My text"); ImagePNG($im); All this outputs is my original PNG image (with no text). I have used the following line instead of ImageTTFText and all works well. ImageString($im, 4, 3, 3, "My text", $text_colour); Using phpinfo() I have checked the GD section and the following is outputted: GD Support - enabled GD Version - 2.0 or higher FreeType Support - enabled FreeType Linkage - with freetype JPG Support - enabled PNG Support - enabled WBMP Support - enabled Does anyone have any suggestions as to why this does not work? Has anyone else used the ImageTTFText function successfully? Neil -------------------------------- Email: neil.freeman@asa.co.uk neil_freeman@yahoo.com -------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.general (#83595) next »