Imager release history. Older releases can be found in Changes.old
-Imager 0.67 - unreleased
+Imager 0.66 - unreleased
===========
+ - 24-bit color .ICO/.CUR files can now be read.
+
Bug fixes:
+ - an optimization skipping 0 src alpha values could cause the
+ rubthrough() to read past the end of a buffer.
+ http://www.nntp.perl.org/group/perl.cpan.testers/2008/05/msg1509184.html
+
- corrected a reference leak where writing GIFs would leak memory.
This could also happen calling to_paletted().
Also documented the underlying long existing feature where the
a relative path could cause failures using Inline::C.
http://rt.cpan.org/Ticket/Display.html?id=37353
-Imager 0.66 - 22 April 2008
-===========
-
- - 24-bit color .ICO/.CUR files can now be read.
-
-Bug fixes:
-
- - an optimization skipping 0 src alpha values could cause the
- rubthrough() to read past the end of a buffer.
- http://www.nntp.perl.org/group/perl.cpan.testers/2008/05/msg1509184.html
+ - re-arrange the POD for Imager::Font::BBox:
+ - mark total_width(), pos_width(), end_offset() obsolete, since
+ they're mostly for backwards compatibility
+ - group width methods and height methods
+ https://rt.cpan.org/Ticket/Display.html?id=39999
Imager 0.65 - 20 May 2008
===========
return $_[0][0];
}
-=item end_offset
+=item advance_width()
-=item pos_width
+The advance width of the string, if the driver supports that,
+otherwise the same as end_offset.
-The offset from the selected drawing location to the right edge of the
-last character drawn. Should always be positive.
+=cut
-You can use the alias pos_width() if you are used to the
-bounding_box() documentation for list context.
+sub advance_width {
+ my $self = shift;
+
+ @$self > 6 ? $self->[6] : $self->[2];
+}
+
+=item right_bearing
+
+The distance from the right of the last glyph to the end of the advance
+point.
+
+If the glyph overflows the right side of the advance width this value
+is negative.
=cut
-sub end_offset {
- return $_[0][2];
+sub right_bearing {
+ my $self = shift;
+
+ @$self >= 8 && return $self->[7]; # driver gives it to us
+
+ # otherwise the closest we have is the difference between the
+ # end_pos and advance_width
+ return $self->advance_width - $self->pos_width;
}
-sub pos_width {
- return $_[0][2];
+=item display_width
+
+The distance from the left-most pixel of the left-most glyph to the
+right-most pixel of the right-most glyph.
+
+Equals advance_width - left_bearing - right_bearing (and implemented
+that way.)
+
+=cut
+
+sub display_width {
+ my ($self) = @_;
+
+ $self->advance_width - $self->left_bearing - $self->right_bearing;
}
=item global_descent()
return $_[0][5];
}
-=item advance_width()
-
-The advance width of the string, if the driver supports that,
-otherwise the same as end_offset.
-
-=cut
-
-sub advance_width {
- my $self = shift;
-
- @$self > 6 ? $self->[6] : $self->[2];
-}
-
-=item total_width()
-
-The total displayed width of the string.
-
-=cut
-
-sub total_width {
- my $self = shift;
-
- $self->end_offset - $self->start_offset;
-}
-
=item font_height()
The maximum displayed height of any string using this font.
$self->ascent - $self->descent;
}
-=item right_bearing
+=back
-The distance from the right of the last glyph to the end of the advance
-point.
+=head1 OBSOLETE METHODS
-If the glyph overflows the right side of the advance width this value
-is negative.
+These methods include bugs kept for backwards compatibility and
+shouldn't be used in new code.
+
+=over
+
+=item total_width()
+
+The total displayed width of the string.
+
+New code should use display_width().
+
+This depends on end_offset(), and is limited by it's backward
+compatibility.
=cut
-sub right_bearing {
+sub total_width {
my $self = shift;
- @$self >= 8 && return $self->[7]; # driver gives it to us
-
- # otherwise the closest we have is the difference between the
- # end_pos and advance_width
- return $self->advance_width - $self->pos_width;
+ $self->end_offset - $self->start_offset;
}
-=item display_width
+=item end_offset
-The distance from the left-most pixel of the left-most glyph to the
-right-most pixel of the right-most glyph.
+=item pos_width
-Equals advance_width - left_bearing - right_bearing (and implemented
-that way.)
+The offset from the selected drawing location to the right edge of the
+last character drawn. Should always be positive.
+
+You can use the alias pos_width() if you are used to the
+bounding_box() documentation for list context.
+
+For backwards compatibility this method returns the maximum of the
+advance width and the offset of the right edge of the last glyph.
=cut
-sub display_width {
- my ($self) = @_;
+sub end_offset {
+ return $_[0][2];
+}
- $self->advance_width - $self->left_bearing - $self->right_bearing;
+sub pos_width {
+ return $_[0][2];
}
=back