I keep getting a “font not found” error whenever I try to use the imagettftext() function with the PHP4 installation on my own computer (running Apache 1.3 on Windows NT4). I have tried putting the fonts into all of the different folders I can think of to try to link from and even have the script using the following code to retrieve the fonts from a specified location but I still get the not found error. Does anyone have any ideas?
[code=php]
$dir = opendir(‘./’);
while (false !== ($file = readdir($dir))) {
if (eregi(‘ttf{1}$’, $file)){
$fonts[] = ‘./’.$file;
}
}
closedir($dir);
$font = realpath($fonts[0]);
imagettftext($image, 44, 15, 50, 200, $blue, $font, “Hello World”);