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

Imager::Font

From: Michael (
02254@xyz.molar.is)
Date: Thu 14 Jun 2001 - 00:02:05 UTC

  • Next message: Mike Depot: "Re: Imager::Font"

    Hi folks;

    I'm going to be the first to ask a dumb newbie type question... :-)

    I have been tinkering with using Imager::Font and have tried playing
    with the example, but I'm getting no where.

    I am getting the following errors...

    Can't modify constant item in read at font.cgi line 15, near ""test.jpg")"
    Not enough arguments for read at font.cgi line 15, near ""test.jpg")"
    Execution of font.cgi aborted due to compilation errors.

    Here is the snippet of code I am trying..

    ############################################

    #!/usr/bin/perl -w

    use Imager;
    use Imager::Font;

      print "Has truetype" if $Imager::formats{tt};
      print "Has t1 postscript" if $Imager::formats{t1};

      $t1font = Imager::Font->new(file => '/usr/share/fonts/default/Type1/a010015l.pfb');

      $red = Imager::Color->new("#FF0000");

      $img=Imager->new();
             $img=read(file=>"test.jpg");
             $img->string(font=>$t1font,
                          text=>"Model-XYZ",
                          x=>0,
                          y=>40,
                          size=>40,
                          color=>$red);
             $img->write(file=>"testout.jpg");

    ###########################################

    All I'm trying to do is just write some simple text onto the jpg...any
    ideas what I'm doing wrong??

    - thanks for any and all help -

     --

           best regards
                    -michael



  •