(none) imager-devel
/ help / lists / applications / search /
 

Re: Problems with Font object

From: Tony Cook (
15103@xyz.molar.is)
Date: Wed 28 Sep 2005 - 23:28:54 GMT


On Wed, Sep 28, 2005 at 10:46:30AM -0700, vulnerable wrote:
> Hi all,
> I Just installed Imager (I'm using cygwin) and I'm having a few
> hickups. I've been trying to use the test code at
> (http://search.cpan.org/~tonyc/Imager-0.45/lib/Imager/Font.pm however
> it doesn't look like the ->new function is executing. I get no errors
> when I construct a font (->new), however I then get a 'can't call
> method "bounding_box" on an undefined value at ./test2.pl line 17'. If
> I print $font; it shows as empty.
>
> Running make test during the install showed that I had truetype
> working, not sure where to go from here.
>
> fwiw, i'm interested in the Imager::Timelinediagram object but i'm
> hitting this wall.

Hi vulnerable,

You don't say how you're checking for errors. Imager won't send
errors to stdout or stderr since in some environments (like CGI) that
could cause problems.

Try:

  Imager::init(log=>'font.log', loglevel => 10);
  my $font = Imager::Font->new(file=>"name of your font file")
    or die Imager->errstr;

and check the log if the message is generic.

If you have FreeType 2 installed and the Imager install picked it up,
you might want to select that since Imager's support for it has better
error handling:

  my $font = Imager::Font->new(file=>"name of your font file", type=>"ft2")
    or die Imager->errstr;

Tony