]> git.imager.perl.org - imager.git/commitdiff
- the right-side bearing used to adjust the final width wasn't being
authorTony Cook <tony@develop=help.com>
Mon, 31 Jan 2005 14:08:57 +0000 (14:08 +0000)
committerTony Cook <tony@develop=help.com>
Mon, 31 Jan 2005 14:08:57 +0000 (14:08 +0000)
  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

Changes
freetyp2.c

diff --git a/Changes b/Changes
index 6e2ae5da181fda40f52d000221da6777cef6b7aa..4dded524ef51c03b6a473ed5e95c5e1c05811eeb 100644 (file)
--- 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
 
 =================================================================
 
index bdcf63d293da342d7cbc55e127a02f7a4c24efbd..8cb6be9cf9b404a5433d28e03cb9f5303263dd89 100644 (file)
@@ -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;
     }