| |
Re: Imager::Font
From: Mike Depot (02293@xyz.molar.is)
Date: Thu 14 Jun 2001 - 00:35:29 UTC
Next message: Michael: "Re: Imager::Font"
you have little typo:
= should be -> on read()
$img=read(file=>"test.jpg");
should be:
$img->read(file=>"test.jpg");
Mike Depot
02293@xyz.molar.is
----- Original Message -----
From: "Michael" <02325@xyz.molar.is>
To: <imager-devel@molar.is>
Sent: Wednesday, June 13, 2001 8:02 PM
Subject: [Imager-devel]: 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
>
>
>
>
| |