diff --git a/src/core/fonts.js b/src/core/fonts.js index 9dd9d3db3..19210e02f 100644 --- a/src/core/fonts.js +++ b/src/core/fonts.js @@ -148,9 +148,9 @@ function adjustToUnicode(properties, builtInEncoding) { if (properties.toUnicode.has(charCode)) { continue; // The font dictionary has a `ToUnicode` entry. } - } else { + } else if (properties.hasEncoding) { if ( - properties.hasEncoding && + properties.differences.length === 0 || properties.differences[charCode] !== undefined ) { continue; // The font dictionary has an `Encoding`/`Differences` entry. diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index acdf66ae4..3790b3514 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -431,6 +431,7 @@ !annotation-square-circle.pdf !annotation-square-circle-without-appearance.pdf !annotation-stamp.pdf +!issue14048.pdf !annotation-fileattachment.pdf !annotation-text-widget.pdf !annotation-choice-widget.pdf diff --git a/test/pdfs/issue14048.pdf b/test/pdfs/issue14048.pdf new file mode 100644 index 000000000..1cf071ee0 Binary files /dev/null and b/test/pdfs/issue14048.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 320cb303e..008196a58 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -4301,6 +4301,12 @@ "rounds": 1, "type": "eq" }, + { "id": "issue14048", + "file": "pdfs/issue14048.pdf", + "md5": "770026875a93dc44a187905f4dcd3de2", + "rounds": 1, + "type": "text" + }, { "id": "blendmode", "file": "pdfs/blendmode.pdf", "md5": "5a86e7e9333e93c58abc3f382e1e6ea2",