Re: Writing text into images, and setting text size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux