File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -298,8 +298,8 @@ void testDevanagari() throws IOException
298298
299299 /**
300300 * PDFBOX-6085: test with the Noto font, this one has a zero width GID between other GIDs and
301- * failed in the past. This "fails before the fix" only with the version 2.004, size 204.336
302- * Bytes .
301+ * failed in the past. This "fails before the fix" only with the version 2.004,
302+ * size 204336 bytes .
303303 *
304304 * @throws IOException
305305 */
@@ -322,6 +322,14 @@ void testDevanagari2() throws IOException
322322 {
323323 InputStream is = TestFontEmbedding .class .getResourceAsStream ("/org/apache/pdfbox/ttf/NotoSansDevanagari-Regular.ttf" );
324324 PDType0Font font = PDType0Font .load (doc , is );
325+
326+ // check that we're using the correct font version. The newer font has a different glyph ordering.
327+ byte [] encoded = font .encode ("A\u200c " );
328+ int val1 = (encoded [0 ] << 8 ) + (encoded [1 ] & 0xff );
329+ int val2 = (encoded [2 ] << 8 ) + (encoded [3 ] & 0xff );
330+ assertEquals (960 , val1 );
331+ assertEquals (132 , val2 );
332+
325333 String s = new String (codepoints , 0 , codepoints .length );
326334 cs .beginText ();
327335 cs .newLineAtOffset (20 , 800 );
You can’t perform that action at this time.
0 commit comments