You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2020/08/18 03:05:34 UTC

svn commit: r1880949 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java

Author: tilman
Date: Tue Aug 18 03:05:33 2020
New Revision: 1880949

URL: http://svn.apache.org/viewvc?rev=1880949&view=rev
Log:
PDFBOX-4934: recover from bad UC2

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java?rev=1880949&r1=1880948&r2=1880949&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType0Font.java Tue Aug 18 03:05:33 2020
@@ -368,9 +368,16 @@ public class PDType0Font extends PDFont
             // try to find the corresponding Unicode (UC2) CMap
             if (strName != null)
             {
-                CMap prdCMap = CMapManager.getPredefinedCMap(strName);
-                String ucs2Name = prdCMap.getRegistry() + "-" + prdCMap.getOrdering() + "-UCS2";
-                cMapUCS2 = CMapManager.getPredefinedCMap(ucs2Name);
+                try
+                {
+                    CMap prdCMap = CMapManager.getPredefinedCMap(strName);
+                    String ucs2Name = prdCMap.getRegistry() + "-" + prdCMap.getOrdering() + "-UCS2";
+                    cMapUCS2 = CMapManager.getPredefinedCMap(ucs2Name);
+                }
+                catch (IOException ex)
+                {
+                    LOG.warn("Could not get " + strName + " UC2 map for font " + getName(), ex);
+                }
             }
         }
     }