gd.txt

# example output:
# http://flodhest.net/files/perl/help/gd.png

use strict;
use warnings;
use GD;

my $img   = GD::Image->new(200, 100);
my $red   = $img->colorAllocate(255, 0, 0); 
my $black = $img->colorAllocate(0, 0, 0); 
my $font  = "/usr/share/fonts/truetype/freefont/FreeSans.ttf";
my $text  = "test: a-æ-b-ø-c-å-d";

$img->string(gdSmallFont, (10, 20), $text, $black);
$img->stringFT($black, $font, 12, 0, (10, 60), $text);

binmode STDOUT;
print $img->png;