From: Tony Cook Date: Mon, 31 Jan 2005 14:08:57 +0000 (+0000) Subject: - the right-side bearing used to adjust the final width wasn't being X-Git-Tag: Imager-0.48^2~222 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/95171801bc65254246fbb6946584b56ec97d143a - the right-side bearing used to adjust the final width wasn't being calculated correctly, this would cause the bounding_box() function for freetype 2.x to return a larger than expected text width. http://rt.cpan.org/NoAuth/Bug.html?id=11291 --- diff --git a/Changes b/Changes index 6e2ae5da..4dded524 100644 --- a/Changes +++ b/Changes @@ -1009,6 +1009,10 @@ Revision history for Perl extension Imager. - minor cleanup of Imager::Fill - eliminate unused variables and static functions - simplify some XS code by adding another typemap entry +- the right-side bearing used to adjust the final width wasn't being + calculated correctly, this would cause the bounding_box() function for + freetype 2.x to return a larger than expected text width. + http://rt.cpan.org/NoAuth/Bug.html?id=11291 ================================================================= diff --git a/freetyp2.c b/freetyp2.c index bdcf63d2..8cb6be9c 100644 --- a/freetyp2.c +++ b/freetyp2.c @@ -388,7 +388,7 @@ i_ft2_bbox(FT2_Fonthandle *handle, double cheight, double cwidth, /* last character handle the case where the right the of the character overlaps the right*/ - rightb = gm->horiAdvance - gm->horiBearingX - gm->width; + rightb = (gm->horiAdvance - gm->horiBearingX - gm->width)/64; if (rightb > 0) rightb = 0; }