pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1784451 - in /pdfbox/trunk: ./ fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java
Date Sun, 26 Feb 2017 14:40:40 GMT
Author: lehmi
Date: Sun Feb 26 14:40:40 2017
New Revision: 1784451

URL: http://svn.apache.org/viewvc?rev=1784451&view=rev
Log:
PDFBOX-3579: use fraction value instead of ignoring it

Modified:
    pdfbox/trunk/   (props changed)
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java

Propchange: pdfbox/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Feb 26 14:40:40 2017
@@ -1,3 +1,3 @@
-/pdfbox/branches/2.0:1760418,1761484,1762133,1763609,1779822,1780783,1780789,1782684
+/pdfbox/branches/2.0:1760418,1761484,1762133,1763609,1779822,1780783,1780789,1782684,1784450
 /pdfbox/branches/no-awt:1618517-1621410
 /pdfbox/no-awt:1618514-1618516

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java?rev=1784451&r1=1784450&r2=1784451&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/Type2CharStringParser.java Sun
Feb 26 14:40:40 2017
@@ -208,7 +208,7 @@ public class Type2CharStringParser
         return new CharStringCommand(b0);
     }
 
-    private Integer readNumber(int b0, DataInput input) throws IOException
+    private Number readNumber(int b0, DataInput input) throws IOException
     {
 
         if (b0 == 28)
@@ -230,15 +230,13 @@ public class Type2CharStringParser
             int b1 = input.readUnsignedByte();
 
             return -(b0 - 251) * 256 - b1 - 108;
-        } 
+        }
         else if (b0 == 255)
         {
             short value = input.readShort();
-            // The lower bytes are representing the digits after 
-            // the decimal point and aren't needed in this context
-            input.readUnsignedByte();
-            input.readUnsignedByte();
-            return (int) value;
+            // The lower bytes are representing the digits after the decimal point
+            double fraction = input.readUnsignedShort() / 65535d;
+            return value + fraction;
         } 
         else
         {



Mime
View raw message