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 2019/04/22 10:28:44 UTC

svn commit: r1857943 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java

Author: tilman
Date: Mon Apr 22 10:28:44 2019
New Revision: 1857943

URL: http://svn.apache.org/viewvc?rev=1857943&view=rev
Log:
PDFBOX-4017: avoid NPE with euro symbol; clarify comment

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1857943&r1=1857942&r2=1857943&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java (original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java Mon Apr 22 10:28:44 2019
@@ -602,17 +602,20 @@ public class PDType1Font extends PDSimpl
                 return uniName;
             }
             // PDFBOX-4017: no postscript table on Windows 10, and the low uni00NN
-            // names are not found. What works is using the PDF code plus 0xF000
+            // names are not found in Symbol font. What works is using the PDF code plus 0xF000
             // while disregarding encoding from the PDF (because of file from PDFBOX-1606,
             // makes sense because this segment is about finding the name in a standard font)
             //TODO bring up better solution than this
             if ("SymbolMT".equals(genericFont.getName()))
             {
-                int code = SymbolEncoding.INSTANCE.getNameToCodeMap().get(name);
-                uniName = getUniNameOfCodePoint(code + 0xF000);
-                if (genericFont.hasGlyph(uniName))
+                Integer code = SymbolEncoding.INSTANCE.getNameToCodeMap().get(name);
+                if (code != null)
                 {
-                    return uniName;
+                    uniName = getUniNameOfCodePoint(code + 0xF000);
+                    if (genericFont.hasGlyph(uniName))
+                    {
+                        return uniName;
+                    }
                 }
             }
         }