Skip Menu |

This queue is for tickets about the Imager CPAN distribution.

Report information
The Basics
Id: 20555
Status: resolved
Priority: 0/
Queue: Imager

People
Owner: TONYC [...] cpan.org
Requestors: TONYC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.51
Fixed in: 0.52



Subject: the bounding box values for a string containing only spaces is strange
Using the T1 with some fonts gives strange results for the values derived from T1_GetStringBBox when the string is empty, or for some fonts when the string contains only spaces. Also, if the string has spaces at the beginning or end the spaces are not included in the bbox, which may not be a bug, but is inconsistent with the ft2 driver and probably the tt driver. use Imager; use strict; use warnings; my $font = "hll_____.pfb"; my $ifont = Imager::Font->new(file => $font, size => 36) or die "$font: $!"; foreach my $string ("", " ", " ", "a", "a ", " a") { print qq{"$string"\t}; my $bbox = $ifont->bounding_box(string => $string); print join ", ", ($bbox->font_height, $bbox->total_width, $bbox->start_offset, $bbox->global_descent); print "\n"; }
Fixed in the development tree.
fixed in Imager 0.52