From 3634406ebfa0f2d5b7ba3abf9b8059dca539a581 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Fri, 3 Jul 2015 10:23:13 +0100 Subject: [PATCH] PDF.js version 1.1.246 --- bower.json | 2 +- build/pdf.combined.js | 67 +++++++++++++++++++++++++------------------ build/pdf.js | 4 +-- build/pdf.worker.js | 67 +++++++++++++++++++++++++------------------ package.json | 2 +- 5 files changed, 82 insertions(+), 60 deletions(-) diff --git a/bower.json b/bower.json index cc916426a..5964900b5 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.244", + "version": "1.1.246", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 6e367b5aa..621948b2f 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.244'; -PDFJS.build = '9ad6af4'; +PDFJS.version = '1.1.246'; +PDFJS.build = 'e3b3481'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -23192,6 +23192,32 @@ var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() { return OpenTypeFileBuilder; })(); +// Problematic Unicode characters in the fonts that needs to be moved to avoid +// issues when they are painted on the canvas, e.g. complex-script shaping or +// control/whitespace characters. The ranges are listed in pairs: the first item +// is a code of the first problematic code, the second one is the next +// non-problematic code. The ranges must be in sorted order. +var ProblematicCharRanges = new Int32Array([ + // Control characters. + 0x0000, 0x0020, + 0x007F, 0x00A1, + 0x00AD, 0x00AE, + // Chars that is used in complex-script shaping. + 0x0600, 0x0780, + 0x08A0, 0x10A0, + 0x1780, 0x1800, + // General punctuation chars. + 0x2000, 0x2010, + 0x2011, 0x2012, + 0x2028, 0x2030, + 0x205F, 0x2070, + 0x25CC, 0x25CD, + // Chars that is used in complex-script shaping. + 0xAA60, 0xAA80, + // Specials Unicode block. + 0xFFF0, 0x10000 +]); + /** * 'Font' is the class the outside world should use, it encapsulate all the font * decoding logics whatever type it is (assuming the font type is supported). @@ -23475,33 +23501,18 @@ var Font = (function FontClosure() { * @return {boolean} */ function isProblematicUnicodeLocation(code) { - if (code <= 0x1F) { // Control chars - return true; - } - if (code >= 0x80 && code <= 0x9F) { // Control chars - return true; - } - if ((code >= 0x2000 && code <= 0x200F) || // General punctuation chars - (code >= 0x2028 && code <= 0x202F) || - (code >= 0x2060 && code <= 0x206F)) { - return true; - } - if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials Unicode block - return true; - } - switch (code) { - case 0x7F: // Control char - case 0xA0: // Non breaking space - case 0xAD: // Soft hyphen - case 0x2011: // Non breaking hyphen - case 0x205F: // Medium mathematical space - case 0x25CC: // Dotted circle (combining mark) - return true; - } - if ((code & ~0xFF) === 0x0E00) { // Thai/Lao chars (with combining mark) - return true; + // Using binary search to find a range start. + var i = 0, j = ProblematicCharRanges.length - 1; + while (i < j) { + var c = (i + j + 1) >> 1; + if (code < ProblematicCharRanges[c]) { + j = c - 1; + } else { + i = c; + } } - return false; + // Even index means code in problematic range. + return !(i & 1); } /** diff --git a/build/pdf.js b/build/pdf.js index 4029d0775..4b900f236 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.244'; -PDFJS.build = '9ad6af4'; +PDFJS.version = '1.1.246'; +PDFJS.build = 'e3b3481'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it diff --git a/build/pdf.worker.js b/build/pdf.worker.js index c819a81bd..7e1f4b2e1 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.1.244'; -PDFJS.build = '9ad6af4'; +PDFJS.version = '1.1.246'; +PDFJS.build = 'e3b3481'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -16793,6 +16793,32 @@ var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() { return OpenTypeFileBuilder; })(); +// Problematic Unicode characters in the fonts that needs to be moved to avoid +// issues when they are painted on the canvas, e.g. complex-script shaping or +// control/whitespace characters. The ranges are listed in pairs: the first item +// is a code of the first problematic code, the second one is the next +// non-problematic code. The ranges must be in sorted order. +var ProblematicCharRanges = new Int32Array([ + // Control characters. + 0x0000, 0x0020, + 0x007F, 0x00A1, + 0x00AD, 0x00AE, + // Chars that is used in complex-script shaping. + 0x0600, 0x0780, + 0x08A0, 0x10A0, + 0x1780, 0x1800, + // General punctuation chars. + 0x2000, 0x2010, + 0x2011, 0x2012, + 0x2028, 0x2030, + 0x205F, 0x2070, + 0x25CC, 0x25CD, + // Chars that is used in complex-script shaping. + 0xAA60, 0xAA80, + // Specials Unicode block. + 0xFFF0, 0x10000 +]); + /** * 'Font' is the class the outside world should use, it encapsulate all the font * decoding logics whatever type it is (assuming the font type is supported). @@ -17076,33 +17102,18 @@ var Font = (function FontClosure() { * @return {boolean} */ function isProblematicUnicodeLocation(code) { - if (code <= 0x1F) { // Control chars - return true; - } - if (code >= 0x80 && code <= 0x9F) { // Control chars - return true; - } - if ((code >= 0x2000 && code <= 0x200F) || // General punctuation chars - (code >= 0x2028 && code <= 0x202F) || - (code >= 0x2060 && code <= 0x206F)) { - return true; - } - if (code >= 0xFFF0 && code <= 0xFFFF) { // Specials Unicode block - return true; - } - switch (code) { - case 0x7F: // Control char - case 0xA0: // Non breaking space - case 0xAD: // Soft hyphen - case 0x2011: // Non breaking hyphen - case 0x205F: // Medium mathematical space - case 0x25CC: // Dotted circle (combining mark) - return true; - } - if ((code & ~0xFF) === 0x0E00) { // Thai/Lao chars (with combining mark) - return true; + // Using binary search to find a range start. + var i = 0, j = ProblematicCharRanges.length - 1; + while (i < j) { + var c = (i + j + 1) >> 1; + if (code < ProblematicCharRanges[c]) { + j = c - 1; + } else { + i = c; + } } - return false; + // Even index means code in problematic range. + return !(i & 1); } /** diff --git a/package.json b/package.json index ff48d62c7..72d6aa4a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.1.244", + "version": "1.1.246", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",