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

Hello guys I have this code from manual, crawled perlmonks for 1 hour and getting back to same thing, the only think can be wrong is incompability
#!/usr/local/bin/perl use GD; # create a new image $im = new GD::Image(200, 36); # allocate some colors $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;
Can any1 plz help, thnx a advance

Replies are listed 'Best First'.
Re: stringTTF problem with AS Perl 629
by mitd (Curate) on Aug 29, 2001 at 01:10 UTC
    some things to ponder:
    1. are you sure True Type support is compiled in ??
      GD::Image->stringTTF ...
      It requires that libgd to have been
      compiled with TrueType support, and for the
      appropriate TrueType font to be installed on your
      system.
    2. Does test.ttf exist as per above.
    3. what does die $! say

    mitd-Made in the Dark
    'My favourite colour appears to be grey.'

Re: stringTTF problem with AS Perl 629
by Beatnik (Parson) on Aug 29, 2001 at 01:05 UTC
    Altho I'm not sure, chances are that FreeType (which handles the TTF stuff in GD) doesn't do Windows, or that it's installed improperly.

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.