|
|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
Author |
Message |
Jo van Duin
|
Pathname of fonts
Hello,
I can't get any chart to work in my project. The examples do work.
I have the following directory-structure:
output (this is my root-directory) |__libs ...|__Pchart .........|__classes .........|__fonts .........|__examples
If I run localhost/output/libs/Pchart/examples/example.basic.php this works.
I copied the example.basic.php to the output-directory and changed the path.
When I run localhost/output/example.basic.php I get an error: De afbeelding “http://localhost/output/example.basic.php” kan niet worden weergegeven, omdat deze fouten bevat. (The image could not be loaded because it contains errors).
Sometimes I get the error: imagettfbbox() [function.imagettfbbox]: Invalid font filename on line 168 of D:\wamp\www\output\libs\pChart\class\pImage.class
I have tried many different path's to the fonts directory but it doesn't work.
The altered source is show below.
<?php /* @ 700x230 Really basic code. */
/* Include all the classes */ include("libs/pChart/class/pData.class"); include("libs/pChart/class/pDraw.class"); include("libs/pChart/class/pImage.class");
/* Create your dataset object */ $myData = new pData(); /* Add data in your dataset */ $myData->addPoints(array(1,3,4,3,5));
/* Create a pChart object and associate your dataset */ $myPicture = new pImage(700,230,$myData);
/* Choose a nice font */ $myPicture->setFontProperties(array("FontName"=>"libs/pChart/fonts/Forgotte.ttf","FontSize"=>10));
/* Define the boundaries of the graph area */ $myPicture->setGraphArea(60,40,670,190);
/* Draw the scale, keep everything automatic */ $myPicture->drawScale();
/* Draw the scale, keep everything automatic */ $myPicture->drawSplineChart();
/* Render the picture (choose the best way) */ $myPicture->autoOutput("basic.png"); ?>
|
Wed Dec 15, 2010 4:31 pm |
|
|
jovanduin@ziggo.nl
|
Re: Pathname of fonts
Problem solved.
|
Sat Dec 18, 2010 4:46 pm |
|
|
Rexyboy
pChart user
Joined: Mon Dec 27, 2010 12:26 pm Posts: 5
|
Re: Pathname of fonts
jovanduin, Can you let me know what you did to resolve this. I am sure that it is a simple solution but it appears that I am having the same problem at the moment.
Thanks.
|
Wed Jan 05, 2011 12:12 am |
|
|
mice32
Experienced pChart user
Joined: Thu Dec 02, 2010 3:03 pm Posts: 36 Location: Somerville, MA, USA
|
Re: Pathname of fonts
Rexyboy, try this (path to font from pImage class): Code: $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>10)); Maybe, It will work
_________________
|
Wed Jan 05, 2011 1:53 am |
|
|
Rexyboy
pChart user
Joined: Mon Dec 27, 2010 12:26 pm Posts: 5
|
Re: Pathname of fonts
I found the problem. As expected it was a silly one. I had a directory of fonts from v1.x and classes from 2.0.8. When I put a clean copy of classes and fonts from 2.0.10 all was good.
Thanks for your help.
|
Wed Jan 05, 2011 8:05 am |
|
|
|
Page 1 of 1
|
[ 5 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 0 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot post attachments in this forum
|
|
|
|