pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1602311 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Token.java
Date Thu, 12 Jun 2014 23:24:49 GMT
Author: jahewson
Date: Thu Jun 12 23:24:49 2014
New Revision: 1602311

URL: http://svn.apache.org/r1602311
Log:
PDFBOX-2133: Tolerate reals in place of integers in Type 1 parser

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Token.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Token.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Token.java?rev=1602311&r1=1602310&r2=1602311&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Token.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/type1/Token.java Thu Jun 12 23:24:49
2014
@@ -99,7 +99,8 @@ class Token
 
     public int intValue()
     {
-        return Integer.parseInt(text);
+        // some fonts have reals where integers should be, so we tolerate it
+        return (int)Float.parseFloat(text);
     }
 
     public float floatValue()



Mime
View raw message