pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1710486 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
Date Sun, 25 Oct 2015 21:28:56 GMT
Author: tilman
Date: Sun Oct 25 21:28:56 2015
New Revision: 1710486

URL: http://svn.apache.org/viewvc?rev=1710486&view=rev
Log:
PDFBOX-3061: don't give up early in PDFont.getWidth() and return 0, return width from font
instead

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?rev=1710486&r1=1710485&r2=1710486&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java Sun Oct 25
21:28:56 2015
@@ -233,7 +233,12 @@ public abstract class PDFont implements
             PDFontDescriptor fd = getFontDescriptor();
             if (fd != null)
             {
-                return fd.getMissingWidth(); // default is 0
+                // get entry from /MissingWidth entry
+                float missingWidth = fd.getMissingWidth();
+                if (missingWidth != 0)
+                {
+                    return missingWidth;
+                }
             }
         }
 



Mime
View raw message