diff --git a/src/fonts.js b/src/fonts.js index 928c63b0a..48dc7c941 100644 --- a/src/fonts.js +++ b/src/fonts.js @@ -4171,12 +4171,16 @@ var Font = (function FontClosure() { } var cidEncoding = properties.cidEncoding; - if (cidEncoding && cidEncoding.indexOf('Identity-') !== 0) { + if (!cidEncoding) { + return; + } + if (cidEncoding.indexOf('Identity-') !== 0) { // input is already Unicode for non-Identity CMap encodings. - // However, Unicode-to-CID conversion is needed - // regardless of the CMap encoding. So we can't reset - // unicodeToCID. this.cidToUnicode = []; + } else { + // We don't have to do reverse conversions if the string is + // already CID. + this.unicodeToCID = []; } }, diff --git a/test/pdfs/.gitignore b/test/pdfs/.gitignore index dd9335f3a..9e0c0ffd5 100644 --- a/test/pdfs/.gitignore +++ b/test/pdfs/.gitignore @@ -40,6 +40,7 @@ !mixedfonts.pdf !shading_extend.pdf !noembed-identity.pdf +!noembed-identity-2.pdf !noembed-jis7.pdf !noembed-eucjp.pdf !noembed-sjis.pdf diff --git a/test/pdfs/noembed-identity-2.pdf b/test/pdfs/noembed-identity-2.pdf new file mode 100644 index 000000000..5bc89bea6 Binary files /dev/null and b/test/pdfs/noembed-identity-2.pdf differ diff --git a/test/test_manifest.json b/test/test_manifest.json index 8fbe6531f..9a4f938ce 100644 --- a/test/test_manifest.json +++ b/test/test_manifest.json @@ -823,6 +823,12 @@ "rounds": 1, "type": "eq" }, + { "id": "noembed-identity-2", + "file": "pdfs/noembed-identity-2.pdf", + "md5": "5549571a910814a9c53a1761b27fd028", + "rounds": 1, + "type": "eq" + }, { "id": "noembed-jis7", "file": "pdfs/noembed-jis7.pdf", "md5": "a0f6cf5a830f23d0c35994a6aaf92b3d",