From da264821f20fa4902daf17bc200d7ded4973d9d5 Mon Sep 17 00:00:00 2001 From: Pdf Bot Date: Thu, 31 Mar 2016 18:46:08 +0100 Subject: [PATCH] PDF.js version 1.4.181 - See mozilla/pdf.js@13d440df6116f171c0b0568aaa5e9608c4600037 --- bower.json | 2 +- build/pdf.combined.js | 75 +++++++++++++++++-------------------------- build/pdf.js | 4 +-- build/pdf.worker.js | 75 +++++++++++++++++-------------------------- package.json | 2 +- 5 files changed, 62 insertions(+), 96 deletions(-) diff --git a/bower.json b/bower.json index 99c46edba..8f919d5bf 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.179", + "version": "1.4.181", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 19c0fb076..93691156d 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.179'; -var pdfjsBuild = '8910cea'; +var pdfjsVersion = '1.4.181'; +var pdfjsBuild = '13d440d'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -29806,7 +29806,7 @@ var ProblematicCharRanges = new Int32Array([ */ var Font = (function FontClosure() { function Font(name, file, properties) { - var charCode, glyphName, unicode, fontChar; + var charCode, glyphName, unicode; this.name = name; this.loadedName = properties.loadedName; @@ -29912,53 +29912,19 @@ var Font = (function FontClosure() { this.toFontChar = map; this.toUnicode = new ToUnicodeMap(map); } else if (/Symbol/i.test(fontName)) { - var symbols = SymbolSetEncoding; - glyphsUnicodeMap = getGlyphsUnicode(); - for (charCode in symbols) { - fontChar = glyphsUnicodeMap[symbols[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = glyphsUnicodeMap[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } + this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), + properties.differences); } else if (/Dingbats/i.test(fontName)) { - glyphsUnicodeMap = getDingbatsGlyphsUnicode(); if (/Wingdings/i.test(name)) { - warn('Wingdings font without embedded font file, ' + - 'falling back to the ZapfDingbats encoding.'); - } - var dingbats = ZapfDingbatsEncoding; - for (charCode in dingbats) { - fontChar = glyphsUnicodeMap[dingbats[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = glyphsUnicodeMap[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; + warn('Non-embedded Wingdings font, falling back to ZapfDingbats.'); } + this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, + getDingbatsGlyphsUnicode(), + properties.differences); } else if (isStandardFont) { - glyphsUnicodeMap = getGlyphsUnicode(); - for (charCode in properties.defaultEncoding) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); - if (unicode !== -1) { - this.toFontChar[charCode] = unicode; - } - } + this.toFontChar = buildToFontChar(properties.defaultEncoding, + getGlyphsUnicode(), + properties.differences); } else { glyphsUnicodeMap = getGlyphsUnicode(); this.toUnicode.forEach(function(charCode, unicodeCharCode) { @@ -30111,6 +30077,23 @@ var Font = (function FontClosure() { return false; } + function buildToFontChar(encoding, glyphsUnicodeMap, differences) { + var toFontChar = [], unicode; + for (var i = 0, ii = encoding.length; i < ii; i++) { + unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[i] = unicode; + } + } + for (var charCode in differences) { + unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[+charCode] = unicode; + } + } + return toFontChar; + } + /** * Helper function for |adjustMapping|. * @return {boolean} diff --git a/build/pdf.js b/build/pdf.js index 727f583ec..d0b980d29 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.179'; -var pdfjsBuild = '8910cea'; +var pdfjsVersion = '1.4.181'; +var pdfjsBuild = '13d440d'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index 188c0867f..c0a4fdcbd 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.4.179'; -var pdfjsBuild = '8910cea'; +var pdfjsVersion = '1.4.181'; +var pdfjsBuild = '13d440d'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -25903,7 +25903,7 @@ var ProblematicCharRanges = new Int32Array([ */ var Font = (function FontClosure() { function Font(name, file, properties) { - var charCode, glyphName, unicode, fontChar; + var charCode, glyphName, unicode; this.name = name; this.loadedName = properties.loadedName; @@ -26009,53 +26009,19 @@ var Font = (function FontClosure() { this.toFontChar = map; this.toUnicode = new ToUnicodeMap(map); } else if (/Symbol/i.test(fontName)) { - var symbols = SymbolSetEncoding; - glyphsUnicodeMap = getGlyphsUnicode(); - for (charCode in symbols) { - fontChar = glyphsUnicodeMap[symbols[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = glyphsUnicodeMap[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } + this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), + properties.differences); } else if (/Dingbats/i.test(fontName)) { - glyphsUnicodeMap = getDingbatsGlyphsUnicode(); if (/Wingdings/i.test(name)) { - warn('Wingdings font without embedded font file, ' + - 'falling back to the ZapfDingbats encoding.'); - } - var dingbats = ZapfDingbatsEncoding; - for (charCode in dingbats) { - fontChar = glyphsUnicodeMap[dingbats[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; - } - for (charCode in properties.differences) { - fontChar = glyphsUnicodeMap[properties.differences[charCode]]; - if (!fontChar) { - continue; - } - this.toFontChar[charCode] = fontChar; + warn('Non-embedded Wingdings font, falling back to ZapfDingbats.'); } + this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, + getDingbatsGlyphsUnicode(), + properties.differences); } else if (isStandardFont) { - glyphsUnicodeMap = getGlyphsUnicode(); - for (charCode in properties.defaultEncoding) { - glyphName = (properties.differences[charCode] || - properties.defaultEncoding[charCode]); - unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); - if (unicode !== -1) { - this.toFontChar[charCode] = unicode; - } - } + this.toFontChar = buildToFontChar(properties.defaultEncoding, + getGlyphsUnicode(), + properties.differences); } else { glyphsUnicodeMap = getGlyphsUnicode(); this.toUnicode.forEach(function(charCode, unicodeCharCode) { @@ -26208,6 +26174,23 @@ var Font = (function FontClosure() { return false; } + function buildToFontChar(encoding, glyphsUnicodeMap, differences) { + var toFontChar = [], unicode; + for (var i = 0, ii = encoding.length; i < ii; i++) { + unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[i] = unicode; + } + } + for (var charCode in differences) { + unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[+charCode] = unicode; + } + } + return toFontChar; + } + /** * Helper function for |adjustMapping|. * @return {boolean} diff --git a/package.json b/package.json index f3b6d0cef..a44837def 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.4.179", + "version": "1.4.181", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [