Subject: | stringBounds returning 0,0 |
Date: | Sun, 15 Jul 2007 18:40:38 -0500 |
To: | bug-GD [...] rt.cpan.org |
From: | "John M. Dlugosz" <john [...] dlugosz.com> |
GD-2.35
ActivePerl under Windows
use strict;
use warnings;
use GD::Simple;
use utf8;
my $Fontpath= 'F:\Windows\Fonts\\'; # edit to match your system
my $img= GD::Simple->new(100,100);
$img->font ($Fontpath . "ARIAL.TTF", 12)
or print STDERR $@;
my $string= "t axis";
my ($dx, $dy)= $img->stringBounds ($string);
print "dx is $dx, dy is $dy\n";
$img->angle (270);
($dx, $dy)= $img->stringBounds ($string);
print "dx is $dx, dy is $dy\n"; # gives 0,0. Should be transpose of
first line.
The TrueType text is supposed to support any angle. The documentation
for stringWidth indicates that this should return the actual offsets
using the current angle etc. Instead, it returns 0.