sub hochkantschrift { my ($STRING,$FONT) = @_; my $FONTSIZE = 12; my $return = join ('
',split (//,$STRING)); # Default, falls bei der andere Variante etwas schief geht my $modul = 1; eval "use GD; use GD::Text; use GD::Text::Align; 1;" or return $return; my $gd_text = GD::Text->new() or return $return; $gd_text->set_font($FONT, $FONTSIZE) or return $return; $gd_text->set_text($STRING) or return $return; my ($w, $h) = $gd_text->get('width', 'height'); my $im = GD::Image->new($h*1.3,$w) or return $return; my $white = $im->colorAllocate(255,255,255); my $color = $im->colorAllocate(0,0,0); # ist Schwarz $im->transparent($white); my $align = GD::Text::Align->new($im) or return $return; $align->set_font($FONT, $FONTSIZE); $align->set_text($STRING); $align->draw($h,$w,3.14/2); open my $file,'>','hochkantschrift.png'; binmode ($file); print $file $im -> png; close $file; return $return; }