You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ja...@apache.org on 2015/10/29 07:02:42 UTC

svn commit: r1711182 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFont.java

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();
         }
     }