 |  | problems GD and GD::Text::Wrap |  | 
01-23-2007, 05:01 AM
| | | problems GD and GD::Text::Wrap 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(); |  |  | Re: problems GD and GD::Text::Wrap |  | 
01-23-2007, 06:08 AM
| | | Re: problems GD and GD::Text::Wrap john.swilting wrote:
When I put align =>'left'
The text displays well
its very obvious for me
> 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(); |  |  | Re: problems GD and GD::Text::Wrap |  | 
01-23-2007, 06:48 AM
| | | Re: problems GD and GD::Text::Wrap john.swilting wrote:
that code its ok
compil
#!/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 $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(); |  |  | Re: problems GD and GD::Text::Wrap |  | 
01-23-2007, 08:05 AM
| | | Re: problems GD and GD::Text::Wrap john.swilting wrote:
> john.swilting wrote:
>
> When I put align =>'left'
> The text displays well
>
> its very obvious for me
>
>> I do not understand
>> Why the text displays badly and swindles
>> my code compil nice
>> It is letters and figures that display vaguenesses
>>
when I put align =>'left'
the text displays badly and swildles again
The size of the image is better
my code compil nice
its very obvious for me
#!/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(1000,60);
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 => 100,
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(10,10);
print $q->header( -type => "image/png", -expires => "-1d");
binmode STDOUT ;
print $gd->png(); |  |  | Re: problems GD and GD::Text::Wrap |  | 
01-23-2007, 08:27 AM
| | | Re: problems GD and GD::Text::Wrap john.swilting wrote:
> my code compil nice
A better way to express that is "My code compiles without warning or errors".
> its very obvious for me
If it is very obvious, then it means you don't have a problem. Right?
If you don't understand what is wrong, you're suppose to say:
It's not obvious to me.
or
I cannot see the problem.
-Joe |  | Re: problems GD and GD::Text::Wrap |  | 
01-23-2007, 08:34 AM
| | | Re: problems GD and GD::Text::Wrap Joe Smith wrote:
> john.swilting wrote:
>
>> my code compil nice
>
> A better way to express that is "My code compiles without warning or
> errors".
>
>> its very obvious for me
>
> If it is very obvious, then it means you don't have a problem. Right?
>
> If you don't understand what is wrong, you're suppose to say:
>
> It's not obvious to me.
>
> or
>
> I cannot see the problem.
>
>
>
> -Joe
its ok
my code conpil nice
the pod is nice
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp;
use GD;
use GD::Text::Wrap;
require "Random.pm";
my $q = new CGI;
my $gd = GD::Image->new(800,600);
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 $wrapbox = GD::Text::Wrap->new( $gd,
line_space => 4,
color => $black,
text => $text,
);
$wrapbox->set_font(gdMediumBoldFont);
$wrapbox->set_font('arial',12);
$wrapbox->set(align => 'center', width => 120);
$wrapbox->draw(10,140);
$gd->rectangle($wrapbox->get_bounds(10,140),$red);
print $q->header( -type => "image/png", -expires => "-1d");
binmode STDOUT ;
print $gd->png(); |  | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | All times are GMT. The time now is 02:30 AM. | | | |