Hi,
Very sorry, my patch has a bug again.
PDF file that is not embedding CID Font is displayed with garbage
characters.

Please apply new patch attached this mail.
new patch for git HEAD at Dec. 25.

In previous patch, It calls getEmbeddedFontName() to check if font is
embedded. But, this method allways return Non-NULL.
So, new patch make it call getEmbeddedID() instead.

----------
Koji Otani.


From: Koji Otani <[EMAIL PROTECTED]>
Subject: Re: [poppler] Problem with your patch
Date: Thu, 20 Dec 2007 14:36:55 +0900 (JST)
Message-ID: <[EMAIL PROTECTED]>

sho> Hi
sho> I found 2 problems.
sho> 
sho> (1) bad location of memory allocation code.
sho>   and use null pointer.
sho>   This causes crash.
sho> 
sho> (2) But, getCodeToGIDMap function is called by the unexpected situation.
sho> In test PDF File (getticket.pdf), fonts are embedded and CIDToGIDMap
sho> entry is not contained. PDF specification sayes that if the TrueType font
sho> program is embedded, the Type 2 CIDFont dictionary must contain a 
sho> CIDToGIDMap entry. (see PDF Reference, version 1.7 page 438).
sho> So, when a font is embedded, getCodeToGIDMap need not be called
sho> because cidToGID map is already set. but if CIDToGIDMap entry is
sho> 'identity' or not contained, getCodeToGIDMap is called and returnes
sho> incorrect cidToGID map.
sho> 
sho> There has been problem(2) since poppler version 0.5.4 (before my
sho> patches were applied.)
sho> 
sho> I attached patch resolves these problems.
sho> 
sho> (1) moved the allocation code to correct location.
sho> (2) When a font is embedded, getCodeToGIDMap returnes cidToGID map
sho> is already set.
sho> 
sho> This patch also removed unused variables. 
sho> 
sho> Please apply this patch.
sho> 
sho> Thanks,
sho> ---------
sho> Koji Otani
sho> 
sho> From: Albert Astals Cid <[EMAIL PROTECTED]>
sho> Subject: Problem with your patch
sho> Date: Wed, 19 Dec 2007 21:18:16 +0100
sho> Message-ID: <[EMAIL PROTECTED]>
sho> 
sho> aacid> Hi Koji, when using poppler head with your latest patches, i get a 
crash in 
sho> aacid> http://bugs.freedesktop.org/attachment.cgi?id=13226
sho> aacid> 
sho> aacid> Could you please have a look?
sho> aacid> 
sho> aacid> I'm attaching the gdb backtrace.
sho> aacid> 
sho> aacid> Albert
diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 1bab34e..79d5a26 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -1807,11 +1807,12 @@ Gushort *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, 
int *mapsizep) {
   CMapListEntry *lp;
   int cmap;
   int cmapPlatform, cmapEncoding;
+  Ref embID;
 
   *mapsizep = 0;
   if (!ctu) return NULL;
   if (getCollection()->cmp("Adobe-Identity") == 0) return NULL;
-  if (getEmbeddedFontName() != NULL) {
+  if (getEmbeddedFontID(&embID)) {
    /* if this font is embedded font, 
     * CIDToGIDMap should be embedded in PDF file
     * and already set. So return it.
_______________________________________________
poppler mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/poppler

Reply via email to