Re: Unable to get ImageTTFText output

From: Date: Tue, 05 Feb 2002 16:52:52 +0000
Subject: Re: Unable to get ImageTTFText output
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-83609@lists.php.net to get a copy of this message
Girish, After a bit of searching around it appears that this is a bug of early versions of PHP, re-introduced in PHP v4.0.6 (the version I was using). I have upgraded to 4.10 and ImageTTFText now works fine. Neil Girish Nath wrote: > 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 > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > *************************************************************** > This message was virus checked with: SAVI 3.53 Jan 2002 > last updated 30th January 2002 > *************************************************************** -- -------------------------------- Email: neil.freeman@asa.co.uk neil_freeman@yahoo.com --------------------------------

« previous php.general (#83609) next »