pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From le...@apache.org
Subject svn commit: r1825820 - in /pdfbox/branches/2.0/fontbox/src: main/java/org/apache/fontbox/cmap/CMapParser.java test/java/org/apache/fontbox/cmap/TestCMapParser.java
Date Sun, 04 Mar 2018 15:57:39 GMT
Author: lehmi
Date: Sun Mar  4 15:57:39 2018
New Revision: 1825820

URL: http://svn.apache.org/viewvc?rev=1825820&view=rev
Log:
PDFBOX-4139: fixed swapped values, added test

Modified:
    pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
    pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java

Modified: pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java?rev=1825820&r1=1825819&r2=1825820&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java (original)
+++ pdfbox/branches/2.0/fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java Sun
Mar  4 15:57:39 2018
@@ -305,7 +305,7 @@ public class CMapParser
                 // some CMaps are using CID ranges to map single values
                 if (end == start)
                 {
-                    result.addCIDMapping(start, mappedCode);
+                    result.addCIDMapping(mappedCode, start);
                 }
                 else
                 {

Modified: pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java?rev=1825820&r1=1825819&r2=1825820&view=diff
==============================================================================
--- pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
(original)
+++ pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/cmap/TestCMapParser.java
Sun Mar  4 15:57:39 2018
@@ -89,6 +89,17 @@ public class TestCMapParser extends Test
         assertEquals("Indentity-H CID 0xFFFF", 0xFFFF, cMap.toCID(0xFFFF));
     }
 
+    public void testUniJIS_UCS2_H() throws IOException
+    {
+        final String resourceDir = "src/main/resources/org/apache/fontbox/cmap";
+        File inDir = new File(resourceDir);
+
+        CMapParser parser = new CMapParser();
+        CMap cMap = parser.parse(new File(inDir, "UniJIS-UCS2-H"));
+
+        assertEquals("UniJIS-UCS2-H CID 65 -> 34", 34, cMap.toCID(65));
+    }
+
     /**
      * Test the parser against a valid, but poorly formatted CMap file.
      * @throws IOException If something went wrong



Mime
View raw message