Re: Writing text into images, and setting text size
| From: | Dave M G | Date: | Tue, 18 Dec 2007 03:31:26 +0000 |
| Subject: | Re: Writing text into images, and setting text size | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-266001@lists.php.net to get a copy of this message | ||
Andrés,
Thank you for responding.
Deploy the fonts along with your scripts... that's the only way I know. ... I do so for a custom CAPTCHA script I've made.This sounds like a good solution. I'm having a little trouble implementing it, however. I have what I believe is a freely distributable font called "FreeSans.ttf", and I put it in a directory called "fonts" in the base directory of my site. However, this seems not to work: $font = 'fonts/FreeSans.ttf'; imagettftext($image, 20, 0, $x, $y, $textColour, $font, $text); Putting a slash in front to specify starting from the base directory - '/fonts/FreeSans.ttf' - does not seem to work either. Looking in the manual, it seemed that maybe I needed to set the font path with putenv: $path = realpath('fonts'); putenv('GDFONTPATH=' . $path); But this yielded no results. Am I still getting the syntax wrong somehow? Thank you for any advice. -- Dave M G