[poppler] poppler/GfxFont.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Oct 22 20:26:32 UTC 2021


 poppler/GfxFont.cc |   12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 81bcacd21f864d37f94d719b70b7faeb433652b8
Author: Albert Astals Cid <aacid at kde.org>
Date:   Fri Oct 22 17:41:48 2021 +0200

    Ignore Adobe-Identity for non embedded CID fonts
    
    As far as I understand it is a "this should not work scenario", but seems other renderers accept it, so do the same

diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc
index 2596255e..6218f5f5 100644
--- a/poppler/GfxFont.cc
+++ b/poppler/GfxFont.cc
@@ -2164,9 +2164,11 @@ int *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *codeToGIDLen)
     *codeToGIDLen = 0;
     if (!ctu || !getCollection())
         return nullptr;
-    if (getCollection()->cmp("Adobe-Identity") == 0)
-        return nullptr;
+
     if (getEmbeddedFontID(&embID)) {
+        if (getCollection()->cmp("Adobe-Identity") == 0)
+            return nullptr;
+
         /* if this font is embedded font,
          * CIDToGIDMap should be embedded in PDF file
          * and already set. So return it.
@@ -2242,7 +2244,11 @@ int *GfxCIDFont::getCodeToGIDMap(FoFiTrueType *ff, int *codeToGIDLen)
         }
         ff->setupGSUB(lp->scriptTag, lp->languageTag);
     } else {
-        error(errSyntaxError, -1, "Unknown character collection {0:t}\n", getCollection());
+        if (getCollection()->cmp("Adobe-Identity") == 0) {
+            error(errSyntaxError, -1, "non-embedded font using identity encoding: {0:t}", getName());
+        } else {
+            error(errSyntaxError, -1, "Unknown character collection {0:t}\n", getCollection());
+        }
         if (ctu) {
             CharCode cid;
             for (cid = 0; cid < n; cid++) {


More information about the poppler mailing list