note 34065 deleted from function.imagettftext by aidan
| From: | aidan@php.net | Date: | Mon, 20 Sep 2004 10:02:51 +0000 |
| Subject: | note 34065 deleted from function.imagettftext by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-77031@lists.php.net to get a copy of this message | ||
Note Submitter: pete at monolight dot org
----
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!