From 6f50d56ceb7a49d4000cfaf52d85617da885d919 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Mon, 19 Sep 2016 10:30:34 +0100 Subject: [PATCH] apply pdfjs font patch https://github.com/mozilla/pdf.js/issues/2594#issuecomment-247644205 --- .../web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js b/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js index 72a29334c6..6ea741047f 100644 --- a/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js +++ b/services/web/public/js/libs/pdfjs-1.3.91p1/pdf.worker.js @@ -18017,7 +18017,7 @@ var Font = (function FontClosure() { } /** - * Helper function for |adjustMapping|. + * Helper function for `adjustMapping`. * @return {boolean} */ function isProblematicUnicodeLocation(code) { @@ -18060,12 +18060,18 @@ var Font = (function FontClosure() { var fontCharCode = originalCharCode; // First try to map the value to a unicode position if a non identity map // was created. + var hasUnicodeValue = false; if (!isIdentityUnicode && toUnicode.has(originalCharCode)) { var unicode = toUnicode.get(fontCharCode); // TODO: Try to map ligatures to the correct spot. if (unicode.length === 1) { fontCharCode = unicode.charCodeAt(0); } + // For Symbolic fonts, we trust the `unicode` value if and only if the + // font includes either `ToUnicode` or `Encoding` data, since otherwise + // `toUnicode` may not be correct. + hasUnicodeValue = properties.hasIncludedToUnicodeMap || + properties.hasEncoding; } // Try to move control characters, special characters and already mapped // characters to the private use area since they will not be drawn by @@ -18075,7 +18081,7 @@ var Font = (function FontClosure() { // with firefox and thuluthfont). if ((usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || - (isSymbolic && isIdentityUnicode)) && + (isSymbolic && !hasUnicodeValue)) && nextAvailableFontCharCode <= PRIVATE_USE_OFFSET_END) { // Room left. // Loop to try and find a free spot in the private use area. do {