Hello, I've discovered this marvelous method imagettftext() PHP: imagettftext - Manual who allows a preview of a TTF font. One problem : it only works when the font is in the same folder than the script. "arial.ttf", when "http://www.mysite.com/data/arial.ttf", it doesn't work. I must put my font in an other folder. Thanks for helping me, Sylvain.
Give absolute path. It seems you are giving path such as "arial.ttf" which PHP manipulates to be http://www.mysite.com/arial.ttf.
Yea this Is what I told : I tried "http://www.mysite.com/data/arial.ttf" but doesn t work, althought the file exist... very strange. Is that what you meant ?
you need absolute path: <?php define('ABSPATH','/directory/where/ttf/is'); // Set the enviroment variable for GD putenv('GDFONTPATH=' . ABSPATH); // Name the font to be used (note the lack of the .ttf extension) $font = 'arial'; ?>