From 8a8af2dbca1a9723580da97129389e4c61b15be6 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Thu, 3 Dec 2015 20:18:24 +0000 Subject: [PATCH] PDF.js version 1.3.54 - See mozilla/pdf.js@e180d01255a45529e48c279881285ba9c2485429 --- bower.json | 2 +- build/pdf.combined.js | 19 ++++++++++++------- build/pdf.js | 4 ++-- build/pdf.worker.js | 19 ++++++++++++------- package.json | 2 +- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/bower.json b/bower.json index 0f95e1725..bf5cebce5 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.52", + "version": "1.3.54", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 38d022d15..1ae88a96f 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.52'; -PDFJS.build = 'e93512f'; +PDFJS.version = '1.3.54'; +PDFJS.build = 'e180d01'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -24573,11 +24573,15 @@ var Font = (function FontClosure() { }; } - function getRanges(glyphs) { + function getRanges(glyphs, numGlyphs) { // Array.sort() sorts by characters, not numerically, so convert to an // array of characters. var codes = []; for (var charCode in glyphs) { + // Remove an invalid glyph ID mappings to make OTS happy. + if (glyphs[charCode] >= numGlyphs) { + continue; + } codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); } codes.sort(function fontGetRangesSort(a, b) { @@ -24606,8 +24610,8 @@ var Font = (function FontClosure() { return ranges; } - function createCmapTable(glyphs) { - var ranges = getRanges(glyphs); + function createCmapTable(glyphs, numGlyphs) { + var ranges = getRanges(glyphs, numGlyphs); var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; var cmap = '\x00\x00' + // version string16(numTables) + // numTables @@ -26110,7 +26114,7 @@ var Font = (function FontClosure() { this.toFontChar = newMapping.toFontChar; tables.cmap = { tag: 'cmap', - data: createCmapTable(newMapping.charCodeToGlyphId) + data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) }; if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { @@ -26248,7 +26252,8 @@ var Font = (function FontClosure() { builder.addTable('OS/2', createOS2Table(properties, newMapping.charCodeToGlyphId)); // Character to glyphs mapping - builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId)); + builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, + numGlyphs)); // Font header builder.addTable('head', '\x00\x01\x00\x00' + // Version number diff --git a/build/pdf.js b/build/pdf.js index b28d9910d..c1ac0162f 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.52'; -PDFJS.build = 'e93512f'; +PDFJS.version = '1.3.54'; +PDFJS.build = 'e180d01'; (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 cd9940477..faaead7f6 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -20,8 +20,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.3.52'; -PDFJS.build = 'e93512f'; +PDFJS.version = '1.3.54'; +PDFJS.build = 'e180d01'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -17462,11 +17462,15 @@ var Font = (function FontClosure() { }; } - function getRanges(glyphs) { + function getRanges(glyphs, numGlyphs) { // Array.sort() sorts by characters, not numerically, so convert to an // array of characters. var codes = []; for (var charCode in glyphs) { + // Remove an invalid glyph ID mappings to make OTS happy. + if (glyphs[charCode] >= numGlyphs) { + continue; + } codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); } codes.sort(function fontGetRangesSort(a, b) { @@ -17495,8 +17499,8 @@ var Font = (function FontClosure() { return ranges; } - function createCmapTable(glyphs) { - var ranges = getRanges(glyphs); + function createCmapTable(glyphs, numGlyphs) { + var ranges = getRanges(glyphs, numGlyphs); var numTables = ranges[ranges.length - 1][1] > 0xFFFF ? 2 : 1; var cmap = '\x00\x00' + // version string16(numTables) + // numTables @@ -18999,7 +19003,7 @@ var Font = (function FontClosure() { this.toFontChar = newMapping.toFontChar; tables.cmap = { tag: 'cmap', - data: createCmapTable(newMapping.charCodeToGlyphId) + data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) }; if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { @@ -19137,7 +19141,8 @@ var Font = (function FontClosure() { builder.addTable('OS/2', createOS2Table(properties, newMapping.charCodeToGlyphId)); // Character to glyphs mapping - builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId)); + builder.addTable('cmap', createCmapTable(newMapping.charCodeToGlyphId, + numGlyphs)); // Font header builder.addTable('head', '\x00\x01\x00\x00' + // Version number diff --git a/package.json b/package.json index d8442c10e..5bbbfc591 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.3.52", + "version": "1.3.54", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",