pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857941 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Date Mon, 22 Apr 2019 10:28:34 GMT
Author: tilman
Date: Mon Apr 22 10:28:34 2019
New Revision: 1857941

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

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1857941&r1=1857940&r2=1857941&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java Mon
Apr 22 10:28:34 2019
@@ -601,17 +601,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;
+                    }
                 }
             }
         }



Mime
View raw message