J
john.swilting
I do not understand
Why the text displays badly and swindles
my code compil nice
It is letters and figures that display vaguenesses
#!/usr/bin/perl -w
use strict;
use GD;
use GD::Text::Wrap;
use CGI;
use CGI::Carp;
require "Random.pm";
my $q = new CGI;
##my $outfile = shift || "GDWrap.png";
my $gd = GD::Image->new(400,240);
my $white = $gd->colorAllocate(255,255,255);
my $black = $gd->colorAllocate( 0, 0, 0);
my $blue = $gd->colorAllocate(127,127,255);
my $red = $gd->colorAllocate(127, 0, 0);
my $text = Random->new();
my $wp = GD::Text::Wrap->new($gd,
width => 180,
line_space => 4,
color => $black,
text => $text,
);
$wp->set(align =>'center', para_space => 10, preserve_nl => 0);
$wp->set_font(['arial', 'Dustismo_Sans'], 10);
$gd->rectangle($wp->get_bounds(10,10), $blue);
$wp->draw(10,10);
$text =~ tr/\n//d;
$wp->set(text => $text);
$wp->set(colour => $white, align => 'center', line_space => 2);
$wp->set_font(gdMediumBoldFont, 12);
$wp->draw(20,10);
print $q->header( -type => "image/png", -expires => "-1d");
binmode STDOUT ;
print $gd->png();
Why the text displays badly and swindles
my code compil nice
It is letters and figures that display vaguenesses
#!/usr/bin/perl -w
use strict;
use GD;
use GD::Text::Wrap;
use CGI;
use CGI::Carp;
require "Random.pm";
my $q = new CGI;
##my $outfile = shift || "GDWrap.png";
my $gd = GD::Image->new(400,240);
my $white = $gd->colorAllocate(255,255,255);
my $black = $gd->colorAllocate( 0, 0, 0);
my $blue = $gd->colorAllocate(127,127,255);
my $red = $gd->colorAllocate(127, 0, 0);
my $text = Random->new();
my $wp = GD::Text::Wrap->new($gd,
width => 180,
line_space => 4,
color => $black,
text => $text,
);
$wp->set(align =>'center', para_space => 10, preserve_nl => 0);
$wp->set_font(['arial', 'Dustismo_Sans'], 10);
$gd->rectangle($wp->get_bounds(10,10), $blue);
$wp->draw(10,10);
$text =~ tr/\n//d;
$wp->set(text => $text);
$wp->set(colour => $white, align => 'center', line_space => 2);
$wp->set_font(gdMediumBoldFont, 12);
$wp->draw(20,10);
print $q->header( -type => "image/png", -expires => "-1d");
binmode STDOUT ;
print $gd->png();