Click to See Complete Forum and Search --> : Could not find/open font


Anon
06-28-2001, 02:14 AM
I keep getting the error "Warning: Could not open/find font in ..." when making calls to ImageTTFBBox and ImageTTFText. I'm running Apache on Win2000, and I'm sure I'm using the correct filename and path. Why won't it open these truetype files? I have GD version 2.0 or higher enabled, and FreeType Linkage, yet these functions won't work! What's wrong??

Anon
08-17-2001, 08:57 PM
Yeah, I'm having the same problem, everything is installed properly (ver 4.06)according to phpinfo() but it won't work.

Anon
09-06-2001, 03:05 AM
I understand from the bugs list on www.php.net that there was a problem with this function on WINNT where it could not open the TTF file in question, and this it has been resolved in the CVS.

As I can not recompile PHP (no compiler for NT etc) does any one know where I can download a version with this patch in it.

Thanks
John

Anon
09-26-2001, 11:53 PM
I use PHP in Linux with Apache, and have the same problem when I use ex:
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "arial.ttf", $text);
(file .php same dir with .ttf)
but if I use absolutely .ttf path:
ImageTTFText($im, $s, 0, (int)($xpad/2)+1, $dy+(int)($ypad/2), $black, "/usr/local/apache/htdocs/arial.ttf", $text);
->it works!

I don't know why.

Anon
09-27-2001, 12:48 AM
Try this under Windows!!!

$fontfile="/WINNT/Fonts/arial.ttf";

ImageTTFText ($image, 15, 0, 10, 20, $white, $fontfile,"Testing...");

p.s. Thanks for your suggestion Luan, it helped!

Anon
05-30-2002, 11:25 PM
I had the same problem, "could not find/open font", using php_gd2.dll on PHP 4.2.1 from www.zend.com on Windows XP...

... but going back to 4.2.0 (downloadable frmo www.php.net) made everything happy again...

Anon
08-08-2002, 08:07 AM
Try to escape all '\' with '\\' in your path to the font.