You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ss...@apache.org on 2017/03/09 13:07:05 UTC

svn commit: r1786161 - /xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java

Author: ssteiner
Date: Thu Mar  9 13:07:05 2017
New Revision: 1786161

URL: http://svn.apache.org/viewvc?rev=1786161&view=rev
Log:
OTF code cleanup

Modified:
    xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java

Modified: xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java?rev=1786161&r1=1786160&r2=1786161&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java (original)
+++ xmlgraphics/fop/trunk/fop-core/src/main/java/org/apache/fop/fonts/truetype/OTFSubSetFile.java Thu Mar  9 13:07:05 2017
@@ -952,16 +952,7 @@ public class OTFSubSetFile extends OTFFi
         for (byte[] aDataArray1 : dataArray) {
             totLength += aDataArray1.length;
         }
-        int offSize = 1;
-        if (totLength < (1 << 8)) {
-            offSize = 1;
-        } else if (totLength < (1 << 16)) {
-            offSize = 2;
-        } else if (totLength < (1 << 24)) {
-            offSize = 3;
-        } else {
-            offSize = 4;
-        }
+        int offSize = getOffSize(totLength);
         this.writeByte(offSize);
         //Count the first offset 1
         hdrTotal += offSize;
@@ -1008,6 +999,19 @@ public class OTFSubSetFile extends OTFFi
         return hdrTotal + total;
     }
 
+    private int getOffSize(int totLength) {
+        int offSize = 1;
+        if (totLength < (1 << 8)) {
+            offSize = 1;
+        } else if (totLength < (1 << 16)) {
+            offSize = 2;
+        } else if (totLength < (1 << 24)) {
+            offSize = 3;
+        } else {
+            offSize = 4;
+        }
+        return offSize;
+    }
     /**
      * A class used to store the last number operand and also it's size in bytes
      */



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org