diff --git a/bower.json b/bower.json index 8cde6c79a..363a01790 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.471", + "version": "1.0.473", "keywords": [ "Mozilla", "pdf", diff --git a/build/pdf.combined.js b/build/pdf.combined.js index e850a170a..4ecb19c07 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.471'; -PDFJS.build = 'faa9020'; +PDFJS.version = '1.0.473'; +PDFJS.build = '1694cd8'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -28872,18 +28872,28 @@ var Font = (function FontClosure() { this.toFontChar = newMapping.toFontChar; var numGlyphs = font.numGlyphs; - function getCharCode(charCodeToGlyphId, glyphId, addMap) { + function getCharCodes(charCodeToGlyphId, glyphId) { + var charCodes = null; for (var charCode in charCodeToGlyphId) { if (glyphId === charCodeToGlyphId[charCode]) { - return charCode | 0; + if (!charCodes) { + charCodes = []; + } + charCodes.push(charCode | 0); } } - if (addMap) { - newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = - glyphId; - return newMapping.nextAvailableFontCharCode++; + return charCodes; + } + + function createCharCode(charCodeToGlyphId, glyphId) { + for (var charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + return charCode | 0; + } } - return null; + newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = + glyphId; + return newMapping.nextAvailableFontCharCode++; } var seacs = font.seacs; @@ -28906,24 +28916,27 @@ var Font = (function FontClosure() { y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] }; - var charCode = getCharCode(mapping, glyphId); - if (charCode === null) { + var charCodes = getCharCodes(mapping, glyphId); + if (!charCodes) { // There's no point in mapping it if the char code was never mapped // to begin with. continue; } - // Find a fontCharCode that maps to the base and accent glyphs. If one - // doesn't exists, create it. - var charCodeToGlyphId = newMapping.charCodeToGlyphId; - var baseFontCharCode = getCharCode(charCodeToGlyphId, baseGlyphId, - true); - var accentFontCharCode = getCharCode(charCodeToGlyphId, accentGlyphId, - true); - seacMap[charCode] = { - baseFontCharCode: baseFontCharCode, - accentFontCharCode: accentFontCharCode, - accentOffset: accentOffset - }; + for (var i = 0, ii = charCodes.length; i < ii; i++) { + var charCode = charCodes[i]; + // Find a fontCharCode that maps to the base and accent glyphs. + // If one doesn't exists, create it. + var charCodeToGlyphId = newMapping.charCodeToGlyphId; + var baseFontCharCode = createCharCode(charCodeToGlyphId, + baseGlyphId); + var accentFontCharCode = createCharCode(charCodeToGlyphId, + accentGlyphId); + seacMap[charCode] = { + baseFontCharCode: baseFontCharCode, + accentFontCharCode: accentFontCharCode, + accentOffset: accentOffset + }; + } } properties.seacMap = seacMap; } diff --git a/build/pdf.js b/build/pdf.js index 6f6c3fb89..386ed0514 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.471'; -PDFJS.build = 'faa9020'; +PDFJS.version = '1.0.473'; +PDFJS.build = '1694cd8'; (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 1525b05a6..1b3fc0e91 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') { (typeof window !== 'undefined' ? window : this).PDFJS = {}; } -PDFJS.version = '1.0.471'; -PDFJS.build = 'faa9020'; +PDFJS.version = '1.0.473'; +PDFJS.build = '1694cd8'; (function pdfjsWrapper() { // Use strict in our context only - users might not want it @@ -24018,18 +24018,28 @@ var Font = (function FontClosure() { this.toFontChar = newMapping.toFontChar; var numGlyphs = font.numGlyphs; - function getCharCode(charCodeToGlyphId, glyphId, addMap) { + function getCharCodes(charCodeToGlyphId, glyphId) { + var charCodes = null; for (var charCode in charCodeToGlyphId) { if (glyphId === charCodeToGlyphId[charCode]) { - return charCode | 0; + if (!charCodes) { + charCodes = []; + } + charCodes.push(charCode | 0); } } - if (addMap) { - newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = - glyphId; - return newMapping.nextAvailableFontCharCode++; + return charCodes; + } + + function createCharCode(charCodeToGlyphId, glyphId) { + for (var charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + return charCode | 0; + } } - return null; + newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = + glyphId; + return newMapping.nextAvailableFontCharCode++; } var seacs = font.seacs; @@ -24052,24 +24062,27 @@ var Font = (function FontClosure() { y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] }; - var charCode = getCharCode(mapping, glyphId); - if (charCode === null) { + var charCodes = getCharCodes(mapping, glyphId); + if (!charCodes) { // There's no point in mapping it if the char code was never mapped // to begin with. continue; } - // Find a fontCharCode that maps to the base and accent glyphs. If one - // doesn't exists, create it. - var charCodeToGlyphId = newMapping.charCodeToGlyphId; - var baseFontCharCode = getCharCode(charCodeToGlyphId, baseGlyphId, - true); - var accentFontCharCode = getCharCode(charCodeToGlyphId, accentGlyphId, - true); - seacMap[charCode] = { - baseFontCharCode: baseFontCharCode, - accentFontCharCode: accentFontCharCode, - accentOffset: accentOffset - }; + for (var i = 0, ii = charCodes.length; i < ii; i++) { + var charCode = charCodes[i]; + // Find a fontCharCode that maps to the base and accent glyphs. + // If one doesn't exists, create it. + var charCodeToGlyphId = newMapping.charCodeToGlyphId; + var baseFontCharCode = createCharCode(charCodeToGlyphId, + baseGlyphId); + var accentFontCharCode = createCharCode(charCodeToGlyphId, + accentGlyphId); + seacMap[charCode] = { + baseFontCharCode: baseFontCharCode, + accentFontCharCode: accentFontCharCode, + accentOffset: accentOffset + }; + } } properties.seacMap = seacMap; } diff --git a/package.json b/package.json index 7fa478abd..460d60367 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.0.471", + "version": "1.0.473", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [ "Mozilla",