mitoteam / jpgraph

JpGraph library composer package with PHP 8.4 support
https://packagist.org/packages/mitoteam/jpgraph
Other
36 stars 5 forks source link

User font with absolute file path is not working #3

Closed f1mishutka closed 2 years ago

f1mishutka commented 2 years ago

JpGraph always prepends font file path with dirname(__FILE__).'/fonts/' path. So it is impossible to use custom TTF fonts outside JpGraph sources folder.

Example: $graph->SetUserFont1('/var/lib/my-fonts/font/Roboto-Regular.ttf');

Solution: do not prepend font file path if it already starts from root ('/').