in reply to Re: GD::Graph Problems: Missing "built-in" font & AUTOLOAD deprecation
in thread GD::Graph Problems: Missing "built-in" font & AUTOLOAD deprecation

Hi, see Font question regarding GD.pm

Your PhP script had no use of True Type Fonts, so just because it ran, dosn't mean your GD libs are up to doing TrueType.

Your problem is just setting up your True Type fonts correctly.

It is a well known problem that GD requires full path names to the ttf file. Just specifying 'arial' won't do. Also read "perldoc GD" and look for the section "Character and String Drawing", wherein it says

$font = GD::Font->load($fontfilepath) This method dynamically loads a font file, returning a font + that you can use in subsequent calls to drawing methods. For example: my $courier = GD::Font->load('./courierR12.fnt') or die +"Can't load font"; $image->string($courier,2,10,"Peachy Keen",$peach);
Even in the docs, the ./courierR12.fnt file is in the scripts working directory. Try copying your arial font file to the CWD of the script. There is also mention of using stringFT for TrueType fonts, google for examples if you need them.

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh
  • Comment on Re^2: GD::Graph Problems: Missing "built-in" font & AUTOLOAD deprecation
  • Download Code