Author: tilman
Date: Tue Jul 22 11:10:59 2025
New Revision: 1927394

Log:
PDFBOX-6015: add test

Modified:
   
pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java

Modified: 
pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java
==============================================================================
--- 
pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java
      Tue Jul 22 11:05:37 2025        (r1927393)
+++ 
pdfbox/branches/2.0/fontbox/src/test/java/org/apache/fontbox/ttf/TTFSubsetterTest.java
      Tue Jul 22 11:10:59 2025        (r1927394)
@@ -347,4 +347,24 @@ public class TTFSubsetterTest
 
         subset.close();
     }
+
+    /**
+     * PDFBOX-6015: test font with 0/1 cmap.
+     *
+     * @throws IOException 
+     */
+    @Test
+    public void testPDFBox6015() throws IOException
+    {
+        TrueTypeFont ttf = new TTFParser()
+                .parse(new File("target/fonts/Keyboard.ttf"));
+        CmapLookup unicodeCmapLookup = ttf.getUnicodeCmapLookup();
+        assertEquals(185, unicodeCmapLookup.getGlyphId('a'));
+        assertEquals(210, unicodeCmapLookup.getGlyphId('z'));
+        assertEquals(159, unicodeCmapLookup.getGlyphId('A'));
+        assertEquals(184, unicodeCmapLookup.getGlyphId('Z'));
+        assertEquals(49, unicodeCmapLookup.getGlyphId('0'));
+        assertEquals(58, unicodeCmapLookup.getGlyphId('9'));
+        ttf.close();
+    }
 }

Reply via email to