[poppler] poppler/GfxFont.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Thu Dec 20 10:59:38 PST 2007


 poppler/GfxFont.cc |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 5f9f06a10fdb72a9d809ee1f779e1a8f549840e7
Author: Koji Otani <sho at bbr.jp>
Date:   Thu Dec 20 19:59:26 2007 +0100

    Fix for latest CJK code
    
    See http://lists.freedesktop.org/archives/poppler/2007-December/003244.html for more information

diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 9a573fe..044e256 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -1802,8 +1802,6 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
   int wmode;
   char **cmapName;
   CMap *cMap;
-  int nUsed;
-  Unicode u;
   CMapListEntry *lp;
   int cmap;
   int cmapPlatform, cmapEncoding;
@@ -1811,6 +1809,14 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
   *mapsizep = 0;
   if (!ctu) return NULL;
   if (getCollection()->cmp("Adobe-Identity") == 0) return NULL;
+  if (getEmbeddedFontName() != NULL) {
+   /* if this font is embedded font, 
+    * CIDToGIDMap should be embedded in PDF file
+    * and already set. So return it.
+    */
+    *mapsizep = getCIDToGIDLen();
+    return getCIDToGID();
+  }
 
   /* we use only unicode cmap */
   cmap = -1;
@@ -1840,6 +1846,8 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
   }
   n = 65536;
   tumap = new Unicode[n];
+  humap = new Unicode[n*N_UCS_CANDIDATES];
+  memset(humap,0,sizeof(Unicode)*n*N_UCS_CANDIDATES);
   if (lp->collection != 0) {
     CharCodeToUnicode *tctu;
     GooString tname(lp->toUnicodeMap);
@@ -1860,8 +1868,6 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *mapsizep) {
       }
       delete tctu;
     }
-    humap = new Unicode[n*N_UCS_CANDIDATES];
-    memset(humap,0,sizeof(Unicode)*n*N_UCS_CANDIDATES);
     vumap = new Unicode[n];
     memset(vumap,0,sizeof(Unicode)*n);
     for (cmapName = lp->CMaps;*cmapName != 0;cmapName++) {


More information about the poppler mailing list