sanPerl has asked for the wisdom of the Perl Monks concerning the following question:
Dear All,
I would like to use TTF as well as OTF fonts to create image of some string. I used use GD::Simple;. I have used following code. This is CGI and dosen't print OTF file data on screen.
I would like to use TTF as well as OTF fonts to create image of some string. I used use GD::Simple;. I have used following code. This is CGI and dosen't print OTF file data on screen.
Please check ## Here this line dosen't work would tell you where the things are going wrong.use strict; use GD::Simple; use CGI; # create a new image my $query = CGI->new(); print $query->header( -type => "image/png"); my $img = GD::Simple->new(1800,1550); # built-in font $img->moveTo(10,100); $img->font('C:\WINNT\Fonts\Arial.ttf'); # Here this line dosen't work #$img->font('C:\WINNT\Zemestrostd-bk.otf'); $img->fontsize(50); $img->string('Hello World'); ######################################## print $img->png;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: OpenType Fonts support in CPAN
by talexb (Chancellor) on Dec 10, 2007 at 14:51 UTC | |
by sanPerl (Friar) on Dec 10, 2007 at 15:08 UTC | |
by talexb (Chancellor) on Dec 10, 2007 at 15:13 UTC | |
by sanPerl (Friar) on Dec 10, 2007 at 15:32 UTC | |
by talexb (Chancellor) on Dec 10, 2007 at 15:39 UTC | |
Re: OpenType Fonts support in CPAN
by almut (Canon) on Dec 11, 2007 at 01:56 UTC |
Back to
Seekers of Perl Wisdom