imagettftext appears to be finding my font, but I keep getting an error trying to run the script that uses it.
The script takes an uploaded image, resizes it using GDLib functions, adds a beige border on the bottom and then burns a caption into that beige border.
When I submit my selected image and caption, I notice in the status bar in IE (5.2.2 Mac OS X) it shows the usual:
"Sending request for /development/admin/addnews.php"
but after a few seconds shows:
"Connecting to www.carepartnership.org" (the host URL)"
And then I get an error box saying:
"The attempt to load 'Accessing URL: http://www.carepartnership.org/development/admin/addnews.php' failed."
Thinking the path to my font:
/home/carepart/public_html/VERDANA.TTF
might be wrong, I tried dropping the ".TTF" and/or dropping the leading slash, both of which got me a "font file not found" message. Otherwise I don't get the message, leading me to believe it is finding the font file.
Tried renaming file to lowercase, using a different font, setting font file permissions to 777 - none worked.
If I don't enter a caption, everything uploads fine.
The offending line is:
ImageTTFText ($dst, $capfontsize, 0, $textleft, $texttop, $black, $fontpath, $linearray[$j]);
where $linearray[$j] is an array of text lines formatted to fit the caption area. Also tried substituting this with a fixed line of text, just to eliminate that possibility.
With the above line commented out, it will still build the beige border to the proper height for the number of lines in the caption, meaning the imagettfbbox line I'm using earlier in the script is working fine, and that accesses the font of course.
I had imagettftext working fine previously in a different configuration, which unfortunately no longer exists.
Also, it all works fine on my local OSX server. The public server is a shared hosting setup, fwiw.
Any ideas what I should try?