pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1626346 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
Date Fri, 19 Sep 2014 21:51:14 GMT
Author: jahewson
Date: Fri Sep 19 21:51:14 2014
New Revision: 1626346

URL: http://svn.apache.org/r1626346
Log:
PDFBOX-2334: Fix NPE

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java?rev=1626346&r1=1626345&r2=1626346&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java Fri
Sep 19 21:51:14 2014
@@ -133,11 +133,20 @@ public abstract class PDSimpleFont exten
         }
 
         // TTFs may have null encoding, but if it's non-symbolic then we have Standard Encoding
-        if (this.encoding == null && getSymbolicFlag() != null && getSymbolicFlag())
+        if (this.encoding == null && getSymbolicFlag() != null && !getSymbolicFlag())
         {
             this.encoding = StandardEncoding.INSTANCE;
         }
 
+        // TTFs may have null encoding, but if it's standard 14 then we know it's Standard
Encoding
+        if (this.encoding == null && isStandard14() &&
+                !getName().equals("Symbol") ||
+                !getName().equals("ZapfDingbats"))
+        {
+            this.encoding = StandardEncoding.INSTANCE;
+        }
+        // todo: what about Symbol and ZapfDingbats?
+
         // assign the glyph list based on the font
         if ("ZapfDingbats".equals(getName()))
         {



Mime
View raw message