0

So I am getting multiple error messages on my webpage;

Warning: imagettftext(): Invalid font filename in on line C:\...\Classes\pChart.class 556, 566, 576, 583, 606, 613, 633, 3329, 3340

Here I am setting the path on my php file, but the error is in the class.php (downloaded from pChart)

$path = config::get("framework")."classes/pChart/";
$Test->setFontProperties($path . "Fonts/tahoma.ttf",10);[/code]

I did find this under installation but don't quite understand it as I believe that is what I did above?

All the ttf files must be accessible from your web scripts, you may need to update the path of the default font using the setFontProperties function :

1.$myPicture->setFontProperties(array("FontName"=>"/home/var/fonts/myfont.ttf");

Any help would be appreciated.

mattz330
  • 59
  • 2
  • 13

1 Answers1

0

Can you check the full path? It is possible that it is not correct, try to show it.

Maybe the line $path = config::get("framework")."classes/pChart/"; needs a slash.

JSLirola
  • 106
  • 1
  • 1
  • 7
  • After echoing out the path, it is correct (with the slash as `config::get("framework")` returns the path with a /. `C:/Users/user1/Documents/the/server/path/framework/classes/pChart/` – mattz330 Jun 23 '15 at 15:42
  • Ok, then try to do like the example with an array: `$myPicture->setFontProperties(array("FontName"=>$path . "Fonts/tahoma.ttf","FontSize"=>10));` – JSLirola Jun 23 '15 at 15:50
  • This gives me more errors, however they are different! `Warning: imageftbbox() expects parameter 3 to be string, array given in C:\Users\user1\Documents\the\server\path\framework\classes\pChart\Classes\pChart.class on line 556` – mattz330 Jun 23 '15 at 15:56
  • Read the documentation. I saw the first var ($FontName) must be in the current path like your initial code. Sorry but i don't know how to fix it. http://pchart.sourceforge.net/documentation.php?topic=pChart# – JSLirola Jun 23 '15 at 17:32