Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: How to use Imager for text

by tonyc (Pilgrim)
on Oct 30, 2005 at 23:44 UTC ( #504081=note: print w/ replies, xml ) Need Help??


in reply to Re^4: How to use Imager for text
in thread How to use Imager for text

Are you seeing any errors creating the font, or in drawing the text?

Which version of Imager are you using? If you're using 0.45 you don't need to set the type parameter.

The following worked fine for me on both OS X and Debian stable (x86):

#!perl -w use strict; use Imager; my $font_file = 'Copperplate.dfont'; my $img = Imager->new(xsize=>400, ysize=>300); $img->box(filled=>1, color=>'white'); my $font = Imager::Font->new(file=>$font_file, index=>1, size=>40, color=>'444444') or die "Cannot load $font_file(1): ", Imager->errstr, "\n"; $img->string(font=>$font, text=>"This is a test string", x=>20, y=>50); $img->write(file=>'test.png') or die Imager->errstr;

Which version of freetype are you using?


Comment on Re^5: How to use Imager for text
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://504081]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2014-12-26 18:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (174 votes), past polls