pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1711182 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java
Date Thu, 29 Oct 2015 06:02:42 GMT
Author: jahewson
Date: Thu Oct 29 06:02:42 2015
New Revision: 1711182

URL: http://svn.apache.org/viewvc?rev=1711182&view=rev
Log:
PDFBOX-2966: fix calculation of CIDFont widths

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java?rev=1711182&r1=1711181&r2=1711182&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java Thu Oct
29 06:02:42 2015
@@ -242,15 +242,7 @@ public abstract class PDCIDFont implemen
         float w0;
         if (widths.containsKey(cid))
         {
-            Float w = widths.get(cid);
-            if (w != null)
-            {
-                w0 = w;
-            }
-            else
-            {
-                w0 = getDefaultWidth();
-            }
+            w0 = widths.get(cid);
         }
         else
         {
@@ -304,23 +296,15 @@ public abstract class PDCIDFont implemen
         // these widths are supposed to be consistent with the actual widths given in the
CIDFont
         // program, but PDFBOX-563 shows that when they are not, Acrobat overrides the embedded
         // font widths with the widths given in the font dictionary
-
+        
         int cid = codeToCID(code);
         if (widths.containsKey(cid))
         {
-            Float w = widths.get(cid);
-            if (w != null)
-            {
-                return w;
-            }
-            else
-            {
-                return getDefaultWidth();
-            }
+            return widths.get(cid);
         }
         else
         {
-            return getWidthFromFont(code);
+            return getDefaultWidth();
         }
     }
 



Mime
View raw message