JPGraph Error


Hello, does dreamhost support jpgraph, I get the following error:

usr/X11R6/lib/x11/fonts/truetype/trubuc.ttf is not readable or does not exist.

How can I correct this, I need to display a graph on my webpage.



Add the font to a local directory and update your ENV paths.


Hello, I did that and still receiving the same error.



Run this:

if (function_exists('imagettfbbox')) {
	echo "TTF functions are available.<br>";
	} else {
	echo "TTF functions are not available.<br>";

And this:

// define path to where your fonts are stored
// define a font file that you know that you have
if( file_exists($f) === false || is_readable($f) === false ) {
	echo "FAILED: Can not read font file \"$f\".";
} else {
	echo "PASSED: Successfully read font file \"$f\".";


The first code gave this result:
TTF functions are available.

The seconf code this:
FAILED: Can not read font file


Did you alter the path and font to reflect your uploaded font’s location ?

[quote]// define path to where your fonts are stored
// define a font file that you know that you have

You did upload a font, yeah?


I’m not using a bunch of fonts, but I’ve ran (Free Version) without issues.
Was using it for testing and got the full version for my job.



yes I have uploaded the font and did the above but still same error.

Does the directory “/fonts” where does this start from on the server from the root or from the the direcotry where the php file is run ?



That’s probably due to my mistake; I missed a leading “.


You can make the path as specific as you like, with your beginning (root) being /home/[username]/

Eg. /home/dimlaz/domain.tld/fonts/arial.ttf

If using a complete path from /home, you can dismiss the preceding .period


Thank you very much for the help, it worked now.

Thanks again


You are more than welcome. Glad everything is working :wink: