[poppler] Branch 'xpdf303merge' - fofi/FoFiTrueType.cc poppler/PSOutputDev.cc splash/SplashFTFont.cc

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Thu Sep 1 08:51:36 PDT 2011


 fofi/FoFiTrueType.cc   |   12 ++++++++++--
 poppler/PSOutputDev.cc |    2 +-
 splash/SplashFTFont.cc |    2 +-
 3 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 68c6ebc78b89eec94a9c3538fe6e27561a21b680
Author: Carlos Garcia Campos <carlosgc at gnome.org>
Date:   Thu Sep 1 17:49:46 2011 +0200

    xpdf303: codeToGID items can be < 0 now

diff --git a/fofi/FoFiTrueType.cc b/fofi/FoFiTrueType.cc
index 53fb1a5..36467f8 100644
--- a/fofi/FoFiTrueType.cc
+++ b/fofi/FoFiTrueType.cc
@@ -1179,8 +1179,16 @@ void FoFiTrueType::writeTTF(FoFiOutputFunc outputFunc,
     newCmapTab[42] = 0;		// idRangeOffset[1]
     newCmapTab[43] = 0;
     for (i = 0; i < 256; ++i) {
-      newCmapTab[44 + 2*i] = codeToGID[i] >> 8;
-      newCmapTab[44 + 2*i + 1] = codeToGID[i] & 0xff;
+      if (codeToGID[i] < 0) {
+	//~ this may not be correct - we want this character to never be
+	//~ displayed, but mapping it to the notdef glyph may result in
+	//~ little boxes being displayed
+	newCmapTab[44 + 2*i] = 0;
+	newCmapTab[44 + 2*i + 1] = 0;
+      } else {
+	newCmapTab[44 + 2*i] = codeToGID[i] >> 8;
+	newCmapTab[44 + 2*i + 1] = codeToGID[i] & 0xff;
+      }
     }
   } else {
     newCmapLen = 0;
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 0f03c2b..5c16d44 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -4625,7 +4625,7 @@ void PSOutputDev::drawString(GfxState *state, GooString *s) {
 	++nChars;
       }
     } else {
-      if (!codeToGID || codeToGID[code]) {
+      if (!codeToGID || codeToGID[code] >= 0) {
 	s2->append((char)code);
       }
     }
diff --git a/splash/SplashFTFont.cc b/splash/SplashFTFont.cc
index d663d08..48df63b 100644
--- a/splash/SplashFTFont.cc
+++ b/splash/SplashFTFont.cc
@@ -291,7 +291,7 @@ double SplashFTFont::getGlyphAdvance(int c)
   } else {
     gid = (FT_UInt)c;
   }
-  if (ff->trueType && gid == 0) {
+  if (ff->trueType && gid < 0) {
     // skip the TrueType notdef glyph
     return -1;
   }


More information about the poppler mailing list