#!/usr/bin/perl -w use 5.008; use strict; use diagnostics; use warnings; use CGI; use CGI::Carp qw (fatalsToBrowser warningsToBrowser); use GD; my $string = "Das ist ein Text!"; my $font = GD::Font->Small; my $height = $font->height; my $width = $font->width; my $im = GD::Image->new($height,5 + $width * length $string); my $white = $im->colorAllocate(255,255,255); my $color = $im->colorAllocate(0,0,0); # ist Schwarz $im->transparent($white); $im->stringUp($font,0,$width * length $string,$string,$color); open my $file,'>','hochkantschrift.png'; binmode ($file); print $file $im->png;