HTTP-404 has asked for the wisdom of the Perl Monks concerning the following question:

Hello thank your for your replies yesterday and today But i came to conculison that windows sucks for perl i have made 2 version of same script 1 GD other ImageMagick, and they both can't output TTF string here the to codes Image Magick:
use Image::Magick; #$image->Quantize(colorspace=>'gray'); $image = Image::Magick->new; $image->Set(size=>'100x100'); $image->ReadImage('xc:white'); $image->Set('pixel[49,49]'=>'red'); $text = 'Dude'; $image->Annotate(font=>'test.ttf', pointsize=>40, stroke=>'green', tex +t=>$text); $filename = "test.png"; $image->Write("$filename");
and GD:
use GD; $im = new GD::Image(200, 36); $white = $im->colorAllocate(255,255,255); $black = $im->colorAllocate(0,0,0); $red = $im->colorAllocate(255,0,0); $blue = $im->colorAllocate(0,0,255); $im->stringTTF($black,"test.ttf", 12, 0, 0, 0,"Font Reactor") or die $ +!; open(IMAGE, ">test.png") or die; binmode IMAGE; print IMAGE $im->png;
I think the only solution for me is to install linux back Thank You for reading my fluff

Replies are listed 'Best First'.
Re: Windows AS Perl 629 no good for Images
by Albannach (Monsignor) on Aug 29, 2001 at 18:17 UTC
    Your problem is you do not understand the arguments to stringTTF - you are placing your test in a position outside your image. Try:

    $im->stringTTF($black,"c:/windows/system/hudson2.ttf", 12, 0, 0, 20,"Font Reactor") or die $!;

    and consider that the point (0,0) is at the top left of the image.

    --
    I'd like to be able to assign to an luser

Re: Windows AS Perl 629 no good for Images
by thunders (Priest) on Nov 10, 2001 at 02:10 UTC
    Funny I have no problem with my copy of perl on windows. Perl as a language works fine, Only problem is that some modules are only tested on *NIX platforms and break on windows. My version of GD works as expected on AS 629 on Windows NT.