Page 1 of 1

PHP GD: Could not find/open font

Posted: Sat Oct 29, 2005 4:06 pm
by RandomEngy
I made a random quote image with PHP and GD and it works most of the time, but about 1 in 10 tries it gives the following errors:

Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettfbbox(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 339
Warning: imagettftext(): Could not find/open font in /hsphere/local/home/randomen/engy.us/randsig.php on line 244
Warning: Cannot modify header information ...

And so on.

You can see it in action if you keep refreshing:

http://engy.us/randsig.php?bgcolor=tran ... &height=80

This is one of the function calls I make. Nothing special, string has stuff in it, size is 10, and font is "./arial.ttf" located in the same folder as the script.

Code: Select all

imagettfbbox($fontsize, 0, $font, $string)
phpinfo: http://engy.us/phpinfo.php

When I searched the problem the only thing I came across was people having trouble with spaces or hyphens in the font names, nothing erratic like this. What's the deal here? Problem with, PHP, GD, or my hosting?