Define a font directory path
Status: Beta
Brought to you by:
ayashisunyday
By default, pChart assumes that it's font files will always be stored in ./Fonts. I have found it troublesome to have to set a font path with each call to setFontProperties. [ setFontProperties('/path/to/font/dir/font.ttf') ]. To solve this, I have extended the class to override the setFontProperties method to use a font directory path. I also have the constructor set the ErrorFontName property to use the font path as well.
It might be worthwhile to include a font path setting in the pChart class.
setFontPath('/path/to/fonts');
setFontProperties('font.ttf');
This is a very good idea and should be extended to any hard-coded paths in the code like tmp/ and cache/.
Many web server installations won't allow writing in the web area so configurable path names are manadory.