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

Re: BUG? Trying to use a non existent font

From: Arnar Mar Hrafnkelsson (
07987@xyz.molar.is)
Date: Wed 16 Apr 2003 - 16:23:56 GMT

  • Next message: Jean-Michel Hiver: "Imager, Unicode and Right to left"

    Hey Jean,

    Typically you check the return code from Imager functions to check for
    error:

    $ perl -wle 'use Imager; my $font = Imager::Font->new(file=>"no_file.ttf", size=>20) or die $Imager::ERRSTR;'
    Font ./no_file.ttf not found at -e line 1.

    $ perl -wle 'use Imager; my $font = Imager::Font->new(file=>"no_file.ttf", size=>20); $img= Imager->new(xsize=>200, ysize=>200); $img->string(x=>23, y=>23, text=>"test", font=>$font) or die $img->errstr();'
    missing required parameter 'font' at -e line 1.

    Hope this helps,
    -Arnar.

    On Wed, 16 Apr 2003, Jean-Michel Hiver wrote:

    > Hi,
    >
    > I had a problem with Imager by specifying:
    >
    > my $font = new Imager::Font
    > file => path_which_does_not_exist(),
    > color => $black,
    > size => 20;
    >
    > And then using $font with $img->string()... Nothing happens! No warning,
    > no error, no nothing. Very confusing!
    >
    > Cheers,
    > --
    > Building a better web - http://www.mkdoc.com/
    > ---------------------------------------------
    > Jean-Michel Hiver
    > 08021@xyz.molar.is - +44 (0)114 255 8097
    > Homepage: http://www.webmatrix.net/
    >
    >
    >



  •