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

[email protected]
Newsgroups gmane.text.xml.fop.cvs
Message-ID <[email protected]>
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
      */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.