in reply to Can't get Imager::Font to work
When I run the truetype capability check (shown above), I get
and the following script works fine for me, if I have Generic.ttf in the script directory.Has t1 postscript Has Freetype2
#!/usr/bin/perl use warnings; use strict; use Imager; my $img = Imager->new(xsize=>400,ysize=>50,channels=>4); my $blue = Imager::Color->new("#0000FF"); my $font = Imager::Font->new( file => 'Generic.ttf', color => $blue, size => 30); $img->string(font => $font, text => "Model-XYZ", x => 15, y => 40, size => 40, color => $blue, aa => 1); $img->write(file=>$0.'.png', type=>'png') or die "Cannot write: ",$img->errstr; my $img_mirror = $img->copy(); $img_mirror->flip( dir => "h" ); $img_mirror->write(file=>$0.'-mirror.png', type=>'png') or die "Cannot write: ",$img_mirror->errstr;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Can't get Imager::Font to work
by boboson (Monk) on Dec 25, 2006 at 20:10 UTC |