note 34065 added to function.imagettftext

From: Date: Tue, 15 Jul 2003 11:33:30 +0000
Subject: note 34065 added to function.imagettftext
Groups: php.notes 
Request: Send a blank email to php-notes+get-52131@lists.php.net to get a copy of this message
I've recently had a problem with a image script that overlays text on top of a truecolour image, using the imagettftext function. The problem is the any text on the image just simply refuses to appear, regardless of specifying the full path of the font file or not. The script used to work fine, until version 4.3.0, and the same problem seems to exist in version 4.3.1 and 4.3.2 For those who are stuck with this problem, here is my work around. You need to create a 2nd overlay image which is the same size as the using the imagecreate function. Then you set the background colour to a transparent colour. Once this is done, use the imagettftext functions to draw the text onto the overlay image. When you have completed drawing onto the overlay image, the image needs to be overlayed onto the truecolour image. Just use the imagecopymerge function with a PCT value of 100. Then continue to use the imageJPEG and imagePNG functions as normal, hopefully with your text on it! ---- Manual Page -- http://www.php.net/manual/en/function.imagettftext.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34065 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34065&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34065&report=yes

« previous php.notes (#52131) next »