pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1630283 - /pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java
Date Thu, 09 Oct 2014 05:04:47 GMT
Author: jahewson
Date: Thu Oct  9 05:04:46 2014
New Revision: 1630283

URL: http://svn.apache.org/r1630283
Log:
PDFBOX-2299: FDSelect uses GIDs, not CIDs

Modified:
    pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java

Modified: pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java?rev=1630283&r1=1630282&r2=1630283&view=diff
==============================================================================
--- pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java (original)
+++ pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/cff/CFFCIDFont.java Thu Oct  9 05:04:46
2014
@@ -166,14 +166,13 @@ public class CFFCIDFont extends CFFFont
     }
 
     /**
-     * Returns the defaultWidthX for the given CID.
+     * Returns the defaultWidthX for the given GID.
      *
-     * @param cid CID
-     * @return defaultWidthX
+     * @param gid GID
      */
-    private int getDefaultWidthX(int cid)
+    private int getDefaultWidthX(int gid)
     {
-        int fdArrayIndex = this.fdSelect.getFDIndex(cid);
+        int fdArrayIndex = this.fdSelect.getFDIndex(gid);
         if (fdArrayIndex == -1)
         {
             return 1000;
@@ -183,14 +182,13 @@ public class CFFCIDFont extends CFFFont
     }
 
     /**
-     * Returns the nominalWidthX for the given CID.
+     * Returns the nominalWidthX for the given GID.
      *
-     * @param cid CID
-     * @return defaultWidthX
+     * @param gid GID
      */
-    private int getNominalWidthX(int cid)
+    private int getNominalWidthX(int gid)
     {
-        int fdArrayIndex = this.fdSelect.getFDIndex(cid);
+        int fdArrayIndex = this.fdSelect.getFDIndex(gid);
         if (fdArrayIndex == -1)
         {
             return 0;
@@ -199,6 +197,11 @@ public class CFFCIDFont extends CFFFont
         return privDict.containsKey("nominalWidthX") ? ((Number)privDict.get("nominalWidthX")).intValue()
: 0;
     }
 
+    /**
+     * Returns the LocalSubrIndex for the given GID.
+     *
+     * @param gid GID
+     */
     private IndexData getLocalSubrIndex(int gid)
     {
         int fdArrayIndex = this.fdSelect.getFDIndex(gid);
@@ -230,7 +233,8 @@ public class CFFCIDFont extends CFFFont
             }
             Type2CharStringParser parser = new Type2CharStringParser(fontName, cid);
             List<Object> type2seq = parser.parse(bytes, globalSubrIndex, getLocalSubrIndex(gid));
-            type2 = new CIDKeyedType2CharString(reader, fontName, cid, gid, type2seq, getDefaultWidthX(cid),
getNominalWidthX(cid));
+            type2 = new CIDKeyedType2CharString(reader, fontName, cid, gid, type2seq,
+                                                getDefaultWidthX(gid), getNominalWidthX(gid));
             charStringCache.put(cid, type2);
         }
         return type2;



Mime
View raw message