splash/Splash.cc       |    6 +++---
 splash/SplashFTFont.cc |   15 +++++++++------
 2 files changed, 12 insertions(+), 9 deletions(-)

New commits:
commit 669cbfc9fd78a22d4f14b0af43143e1f5dc28cd5
Author: Albert Astals Cid <[email protected]>
Date:   Sat Dec 11 19:04:22 2010 +0000

    Fix the preliminary bbox/clip calculation
    
    Code based in code posted by Suzuki Toshiya in the freetype mailing list

diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc
index 4516297..5e86311 100644
--- a/splash/SplashFTFont.cc
+++ b/splash/SplashFTFont.cc
@@ -14,6 +14,7 @@
 // Copyright (C) 2005, 2007-2010 Albert Astals Cid <[email protected]>
 // Copyright (C) 2006 Kristian Høgsberg <[email protected]>
 // Copyright (C) 2009 Petr Gajdos <[email protected]>
+// Copyright (C) 2010 Suzuki Toshiya <[email protected]>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -204,12 +205,14 @@ GBool SplashFTFont::makeGlyph(int c, int xFrac, int yFrac,
     return gFalse;
   }
 
-  FT_Glyph_Metrics *glyphMetrics = &(ff->face->glyph->metrics);
-  // prelimirary values from FT_Glyph_Metrics
-  bitmap->x = splashRound(-glyphMetrics->horiBearingX / 64.0);
-  bitmap->y = splashRound(glyphMetrics->horiBearingY / 64.0);
-  bitmap->w = splashRound(glyphMetrics->width / 64.0);
-  bitmap->h = splashRound(glyphMetrics->height / 64.0);
+  // prelimirary values based on FT_Outline_Get_CBox
+  // we add two pixels to each side to be in the safe side
+  FT_BBox cbox;
+  FT_Outline_Get_CBox(&ff->face->glyph->outline, &cbox);
+  bitmap->x = -(cbox.xMin / 64) + 2;
+  bitmap->y =  (cbox.yMax / 64) + 2;
+  bitmap->w = ((cbox.xMax - cbox.xMin) / 64) + 4;
+  bitmap->h = ((cbox.yMax - cbox.yMin) / 64) + 4;
 
   *clipRes = clip->testRect(x0 - bitmap->x,
                             y0 - bitmap->y,
commit 2984002a64acca7014edeadd900dd52cdf7d9eac
Author: Albert Astals Cid <[email protected]>
Date:   Sat Dec 11 18:57:52 2010 +0000

    Remove the * we just need to increase the pointer
    
    Gives a warning with newer gcc's

diff --git a/splash/Splash.cc b/splash/Splash.cc
index f36f616..bc317a6 100644
--- a/splash/Splash.cc
+++ b/splash/Splash.cc
@@ -2601,7 +2601,7 @@ SplashError Splash::drawImage(SplashImageSource src, void 
*srcData,
              pixAcc0 += *p++;
              pixAcc1 += *p++;
              pixAcc2 += *p++;
-             *p++;
+             p++;
              alphaAcc += *q++;
            }
            p += 4 * (w - m);
@@ -2930,7 +2930,7 @@ SplashError Splash::drawImage(SplashImageSource src, void 
*srcData,
              pixAcc0 += *p++;
              pixAcc1 += *p++;
              pixAcc2 += *p++;
-             *p++;
+             p++;
            }
            p += 4 * (w - m);
          }
@@ -3591,7 +3591,7 @@ SplashError Splash::blitTransparent(SplashBitmap *src, 
int xSrc, int ySrc,
        *p++ = *sp++;
        *p++ = *sp++;
        *p++ = 255;
-       *sp++;
+       sp++;
       }
     }
     break;
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to