Merge pull request #6915 from yurydelendik/lookuptables

Refactor lookup hash tables/objects
This commit is contained in:
Yury Delendik 2016-01-28 15:01:06 -06:00
commit 825a2225ab
23 changed files with 9970 additions and 9667 deletions

View File

@ -313,9 +313,9 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
this.currRequestId = 0;
this.chunksNeededByRequest = {};
this.requestsByChunk = {};
this.promisesByRequest = {};
this.chunksNeededByRequest = Object.create(null);
this.requestsByChunk = Object.create(null);
this.promisesByRequest = Object.create(null);
this.progressiveDataLength = 0;
this._loadedStreamCapability = createPromiseCapability();
@ -341,9 +341,9 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
_requestChunks: function ChunkedStreamManager_requestChunks(chunks) {
var requestId = this.currRequestId++;
var chunksNeeded;
var i, ii;
this.chunksNeededByRequest[requestId] = chunksNeeded = {};
var chunksNeeded = Object.create(null);
this.chunksNeededByRequest[requestId] = chunksNeeded;
for (i = 0, ii = chunks.length; i < ii; i++) {
if (!this.stream.hasChunk(chunks[i])) {
chunksNeeded[chunks[i]] = true;

304
src/core/encodings.js Normal file
View File

@ -0,0 +1,304 @@
/* Copyright 2012 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/encodings', ['exports'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports);
} else {
factory((root.pdfjsCoreEncodings = {}));
}
}(this, function (exports) {
var ExpertEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclamsmall', 'Hungarumlautsmall', '', 'dollaroldstyle',
'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior',
'parenrightsuperior', 'twodotenleader', 'onedotenleader', 'comma',
'hyphen', 'period', 'fraction', 'zerooldstyle', 'oneoldstyle',
'twooldstyle', 'threeoldstyle', 'fouroldstyle', 'fiveoldstyle',
'sixoldstyle', 'sevenoldstyle', 'eightoldstyle', 'nineoldstyle', 'colon',
'semicolon', 'commasuperior', 'threequartersemdash', 'periodsuperior',
'questionsmall', '', 'asuperior', 'bsuperior', 'centsuperior', 'dsuperior',
'esuperior', '', '', 'isuperior', '', '', 'lsuperior', 'msuperior',
'nsuperior', 'osuperior', '', '', 'rsuperior', 'ssuperior', 'tsuperior',
'', 'ff', 'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '',
'parenrightinferior', 'Circumflexsmall', 'hyphensuperior', 'Gravesmall',
'Asmall', 'Bsmall', 'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall',
'Hsmall', 'Ismall', 'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall',
'Osmall', 'Psmall', 'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall',
'Vsmall', 'Wsmall', 'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary',
'onefitted', 'rupiah', 'Tildesmall', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', 'exclamdownsmall', 'centoldstyle', 'Lslashsmall',
'', '', 'Scaronsmall', 'Zcaronsmall', 'Dieresissmall', 'Brevesmall',
'Caronsmall', '', 'Dotaccentsmall', '', '', 'Macronsmall', '', '',
'figuredash', 'hypheninferior', '', '', 'Ogoneksmall', 'Ringsmall',
'Cedillasmall', '', '', '', 'onequarter', 'onehalf', 'threequarters',
'questiondownsmall', 'oneeighth', 'threeeighths', 'fiveeighths',
'seveneighths', 'onethird', 'twothirds', '', '', 'zerosuperior',
'onesuperior', 'twosuperior', 'threesuperior', 'foursuperior',
'fivesuperior', 'sixsuperior', 'sevensuperior', 'eightsuperior',
'ninesuperior', 'zeroinferior', 'oneinferior', 'twoinferior',
'threeinferior', 'fourinferior', 'fiveinferior', 'sixinferior',
'seveninferior', 'eightinferior', 'nineinferior', 'centinferior',
'dollarinferior', 'periodinferior', 'commainferior', 'Agravesmall',
'Aacutesmall', 'Acircumflexsmall', 'Atildesmall', 'Adieresissmall',
'Aringsmall', 'AEsmall', 'Ccedillasmall', 'Egravesmall', 'Eacutesmall',
'Ecircumflexsmall', 'Edieresissmall', 'Igravesmall', 'Iacutesmall',
'Icircumflexsmall', 'Idieresissmall', 'Ethsmall', 'Ntildesmall',
'Ogravesmall', 'Oacutesmall', 'Ocircumflexsmall', 'Otildesmall',
'Odieresissmall', 'OEsmall', 'Oslashsmall', 'Ugravesmall', 'Uacutesmall',
'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall',
'Ydieresissmall'];
var MacExpertEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclamsmall', 'Hungarumlautsmall', 'centoldstyle',
'dollaroldstyle', 'dollarsuperior', 'ampersandsmall', 'Acutesmall',
'parenleftsuperior', 'parenrightsuperior', 'twodotenleader',
'onedotenleader', 'comma', 'hyphen', 'period', 'fraction', 'zerooldstyle',
'oneoldstyle', 'twooldstyle', 'threeoldstyle', 'fouroldstyle',
'fiveoldstyle', 'sixoldstyle', 'sevenoldstyle', 'eightoldstyle',
'nineoldstyle', 'colon', 'semicolon', '', 'threequartersemdash', '',
'questionsmall', '', '', '', '', 'Ethsmall', '', '', 'onequarter',
'onehalf', 'threequarters', 'oneeighth', 'threeeighths', 'fiveeighths',
'seveneighths', 'onethird', 'twothirds', '', '', '', '', '', '', 'ff',
'fi', 'fl', 'ffi', 'ffl', 'parenleftinferior', '', 'parenrightinferior',
'Circumflexsmall', 'hypheninferior', 'Gravesmall', 'Asmall', 'Bsmall',
'Csmall', 'Dsmall', 'Esmall', 'Fsmall', 'Gsmall', 'Hsmall', 'Ismall',
'Jsmall', 'Ksmall', 'Lsmall', 'Msmall', 'Nsmall', 'Osmall', 'Psmall',
'Qsmall', 'Rsmall', 'Ssmall', 'Tsmall', 'Usmall', 'Vsmall', 'Wsmall',
'Xsmall', 'Ysmall', 'Zsmall', 'colonmonetary', 'onefitted', 'rupiah',
'Tildesmall', '', '', 'asuperior', 'centsuperior', '', '', '', '',
'Aacutesmall', 'Agravesmall', 'Acircumflexsmall', 'Adieresissmall',
'Atildesmall', 'Aringsmall', 'Ccedillasmall', 'Eacutesmall', 'Egravesmall',
'Ecircumflexsmall', 'Edieresissmall', 'Iacutesmall', 'Igravesmall',
'Icircumflexsmall', 'Idieresissmall', 'Ntildesmall', 'Oacutesmall',
'Ogravesmall', 'Ocircumflexsmall', 'Odieresissmall', 'Otildesmall',
'Uacutesmall', 'Ugravesmall', 'Ucircumflexsmall', 'Udieresissmall', '',
'eightsuperior', 'fourinferior', 'threeinferior', 'sixinferior',
'eightinferior', 'seveninferior', 'Scaronsmall', '', 'centinferior',
'twoinferior', '', 'Dieresissmall', '', 'Caronsmall', 'osuperior',
'fiveinferior', '', 'commainferior', 'periodinferior', 'Yacutesmall', '',
'dollarinferior', '', 'Thornsmall', '', 'nineinferior', 'zeroinferior',
'Zcaronsmall', 'AEsmall', 'Oslashsmall', 'questiondownsmall',
'oneinferior', 'Lslashsmall', '', '', '', '', '', '', 'Cedillasmall', '',
'', '', '', '', 'OEsmall', 'figuredash', 'hyphensuperior', '', '', '', '',
'exclamdownsmall', '', 'Ydieresissmall', '', 'onesuperior', 'twosuperior',
'threesuperior', 'foursuperior', 'fivesuperior', 'sixsuperior',
'sevensuperior', 'ninesuperior', 'zerosuperior', '', 'esuperior',
'rsuperior', 'tsuperior', '', '', 'isuperior', 'ssuperior', 'dsuperior',
'', '', '', '', '', 'lsuperior', 'Ogoneksmall', 'Brevesmall',
'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior',
'periodsuperior', 'Dotaccentsmall', 'Ringsmall'];
var MacRomanEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus',
'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three',
'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon',
'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde', '',
'Adieresis', 'Aring', 'Ccedilla', 'Eacute', 'Ntilde', 'Odieresis',
'Udieresis', 'aacute', 'agrave', 'acircumflex', 'adieresis', 'atilde',
'aring', 'ccedilla', 'eacute', 'egrave', 'ecircumflex', 'edieresis',
'iacute', 'igrave', 'icircumflex', 'idieresis', 'ntilde', 'oacute',
'ograve', 'ocircumflex', 'odieresis', 'otilde', 'uacute', 'ugrave',
'ucircumflex', 'udieresis', 'dagger', 'degree', 'cent', 'sterling',
'section', 'bullet', 'paragraph', 'germandbls', 'registered', 'copyright',
'trademark', 'acute', 'dieresis', 'notequal', 'AE', 'Oslash', 'infinity',
'plusminus', 'lessequal', 'greaterequal', 'yen', 'mu', 'partialdiff',
'summation', 'product', 'pi', 'integral', 'ordfeminine', 'ordmasculine',
'Omega', 'ae', 'oslash', 'questiondown', 'exclamdown', 'logicalnot',
'radical', 'florin', 'approxequal', 'Delta', 'guillemotleft',
'guillemotright', 'ellipsis', 'space', 'Agrave', 'Atilde', 'Otilde', 'OE',
'oe', 'endash', 'emdash', 'quotedblleft', 'quotedblright', 'quoteleft',
'quoteright', 'divide', 'lozenge', 'ydieresis', 'Ydieresis', 'fraction',
'currency', 'guilsinglleft', 'guilsinglright', 'fi', 'fl', 'daggerdbl',
'periodcentered', 'quotesinglbase', 'quotedblbase', 'perthousand',
'Acircumflex', 'Ecircumflex', 'Aacute', 'Edieresis', 'Egrave', 'Iacute',
'Icircumflex', 'Idieresis', 'Igrave', 'Oacute', 'Ocircumflex', 'apple',
'Ograve', 'Uacute', 'Ucircumflex', 'Ugrave', 'dotlessi', 'circumflex',
'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut',
'ogonek', 'caron'];
var StandardEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus',
'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three',
'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon',
'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
'asciicircum', 'underscore', 'quoteleft', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u',
'v', 'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'exclamdown',
'cent', 'sterling', 'fraction', 'yen', 'florin', 'section', 'currency',
'quotesingle', 'quotedblleft', 'guillemotleft', 'guilsinglleft',
'guilsinglright', 'fi', 'fl', '', 'endash', 'dagger', 'daggerdbl',
'periodcentered', '', 'paragraph', 'bullet', 'quotesinglbase',
'quotedblbase', 'quotedblright', 'guillemotright', 'ellipsis',
'perthousand', '', 'questiondown', '', 'grave', 'acute', 'circumflex',
'tilde', 'macron', 'breve', 'dotaccent', 'dieresis', '', 'ring', 'cedilla',
'', 'hungarumlaut', 'ogonek', 'caron', 'emdash', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', 'AE', '', 'ordfeminine', '', '',
'', '', 'Lslash', 'Oslash', 'OE', 'ordmasculine', '', '', '', '', '', 'ae',
'', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls'];
var WinAnsiEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
'ampersand', 'quotesingle', 'parenleft', 'parenright', 'asterisk', 'plus',
'comma', 'hyphen', 'period', 'slash', 'zero', 'one', 'two', 'three',
'four', 'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon',
'less', 'equal', 'greater', 'question', 'at', 'A', 'B', 'C', 'D', 'E', 'F',
'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U',
'V', 'W', 'X', 'Y', 'Z', 'bracketleft', 'backslash', 'bracketright',
'asciicircum', 'underscore', 'grave', 'a', 'b', 'c', 'd', 'e', 'f', 'g',
'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
'w', 'x', 'y', 'z', 'braceleft', 'bar', 'braceright', 'asciitilde',
'bullet', 'Euro', 'bullet', 'quotesinglbase', 'florin', 'quotedblbase',
'ellipsis', 'dagger', 'daggerdbl', 'circumflex', 'perthousand', 'Scaron',
'guilsinglleft', 'OE', 'bullet', 'Zcaron', 'bullet', 'bullet', 'quoteleft',
'quoteright', 'quotedblleft', 'quotedblright', 'bullet', 'endash',
'emdash', 'tilde', 'trademark', 'scaron', 'guilsinglright', 'oe', 'bullet',
'zcaron', 'Ydieresis', 'space', 'exclamdown', 'cent', 'sterling',
'currency', 'yen', 'brokenbar', 'section', 'dieresis', 'copyright',
'ordfeminine', 'guillemotleft', 'logicalnot', 'hyphen', 'registered',
'macron', 'degree', 'plusminus', 'twosuperior', 'threesuperior', 'acute',
'mu', 'paragraph', 'periodcentered', 'cedilla', 'onesuperior',
'ordmasculine', 'guillemotright', 'onequarter', 'onehalf', 'threequarters',
'questiondown', 'Agrave', 'Aacute', 'Acircumflex', 'Atilde', 'Adieresis',
'Aring', 'AE', 'Ccedilla', 'Egrave', 'Eacute', 'Ecircumflex', 'Edieresis',
'Igrave', 'Iacute', 'Icircumflex', 'Idieresis', 'Eth', 'Ntilde', 'Ograve',
'Oacute', 'Ocircumflex', 'Otilde', 'Odieresis', 'multiply', 'Oslash',
'Ugrave', 'Uacute', 'Ucircumflex', 'Udieresis', 'Yacute', 'Thorn',
'germandbls', 'agrave', 'aacute', 'acircumflex', 'atilde', 'adieresis',
'aring', 'ae', 'ccedilla', 'egrave', 'eacute', 'ecircumflex', 'edieresis',
'igrave', 'iacute', 'icircumflex', 'idieresis', 'eth', 'ntilde', 'ograve',
'oacute', 'ocircumflex', 'otilde', 'odieresis', 'divide', 'oslash',
'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn',
'ydieresis'];
var SymbolSetEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'exclam', 'universal', 'numbersign', 'existential', 'percent',
'ampersand', 'suchthat', 'parenleft', 'parenright', 'asteriskmath', 'plus',
'comma', 'minus', 'period', 'slash', 'zero', 'one', 'two', 'three', 'four',
'five', 'six', 'seven', 'eight', 'nine', 'colon', 'semicolon', 'less',
'equal', 'greater', 'question', 'congruent', 'Alpha', 'Beta', 'Chi',
'Delta', 'Epsilon', 'Phi', 'Gamma', 'Eta', 'Iota', 'theta1', 'Kappa',
'Lambda', 'Mu', 'Nu', 'Omicron', 'Pi', 'Theta', 'Rho', 'Sigma', 'Tau',
'Upsilon', 'sigma1', 'Omega', 'Xi', 'Psi', 'Zeta', 'bracketleft',
'therefore', 'bracketright', 'perpendicular', 'underscore', 'radicalex',
'alpha', 'beta', 'chi', 'delta', 'epsilon', 'phi', 'gamma', 'eta', 'iota',
'phi1', 'kappa', 'lambda', 'mu', 'nu', 'omicron', 'pi', 'theta', 'rho',
'sigma', 'tau', 'upsilon', 'omega1', 'omega', 'xi', 'psi', 'zeta',
'braceleft', 'bar', 'braceright', 'similar', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', 'Euro', 'Upsilon1', 'minute', 'lessequal',
'fraction', 'infinity', 'florin', 'club', 'diamond', 'heart', 'spade',
'arrowboth', 'arrowleft', 'arrowup', 'arrowright', 'arrowdown', 'degree',
'plusminus', 'second', 'greaterequal', 'multiply', 'proportional',
'partialdiff', 'bullet', 'divide', 'notequal', 'equivalence',
'approxequal', 'ellipsis', 'arrowvertex', 'arrowhorizex', 'carriagereturn',
'aleph', 'Ifraktur', 'Rfraktur', 'weierstrass', 'circlemultiply',
'circleplus', 'emptyset', 'intersection', 'union', 'propersuperset',
'reflexsuperset', 'notsubset', 'propersubset', 'reflexsubset', 'element',
'notelement', 'angle', 'gradient', 'registerserif', 'copyrightserif',
'trademarkserif', 'product', 'radical', 'dotmath', 'logicalnot',
'logicaland', 'logicalor', 'arrowdblboth', 'arrowdblleft', 'arrowdblup',
'arrowdblright', 'arrowdbldown', 'lozenge', 'angleleft', 'registersans',
'copyrightsans', 'trademarksans', 'summation', 'parenlefttp',
'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex',
'bracketleftbt', 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex',
'', 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt',
'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp',
'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid',
'bracerightbt'];
var ZapfDingbatsEncoding = [
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
'space', 'a1', 'a2', 'a202', 'a3', 'a4', 'a5', 'a119', 'a118', 'a117',
'a11', 'a12', 'a13', 'a14', 'a15', 'a16', 'a105', 'a17', 'a18', 'a19',
'a20', 'a21', 'a22', 'a23', 'a24', 'a25', 'a26', 'a27', 'a28', 'a6', 'a7',
'a8', 'a9', 'a10', 'a29', 'a30', 'a31', 'a32', 'a33', 'a34', 'a35', 'a36',
'a37', 'a38', 'a39', 'a40', 'a41', 'a42', 'a43', 'a44', 'a45', 'a46',
'a47', 'a48', 'a49', 'a50', 'a51', 'a52', 'a53', 'a54', 'a55', 'a56',
'a57', 'a58', 'a59', 'a60', 'a61', 'a62', 'a63', 'a64', 'a65', 'a66',
'a67', 'a68', 'a69', 'a70', 'a71', 'a72', 'a73', 'a74', 'a203', 'a75',
'a204', 'a76', 'a77', 'a78', 'a79', 'a81', 'a82', 'a83', 'a84', 'a97',
'a98', 'a99', 'a100', '', 'a89', 'a90', 'a93', 'a94', 'a91', 'a92', 'a205',
'a85', 'a206', 'a86', 'a87', 'a88', 'a95', 'a96', '', '', '', '', '', '',
'', '', '', '', '', '', '', '', '', '', '', '', '', 'a101', 'a102', 'a103',
'a104', 'a106', 'a107', 'a108', 'a112', 'a111', 'a110', 'a109', 'a120',
'a121', 'a122', 'a123', 'a124', 'a125', 'a126', 'a127', 'a128', 'a129',
'a130', 'a131', 'a132', 'a133', 'a134', 'a135', 'a136', 'a137', 'a138',
'a139', 'a140', 'a141', 'a142', 'a143', 'a144', 'a145', 'a146', 'a147',
'a148', 'a149', 'a150', 'a151', 'a152', 'a153', 'a154', 'a155', 'a156',
'a157', 'a158', 'a159', 'a160', 'a161', 'a163', 'a164', 'a196', 'a165',
'a192', 'a166', 'a167', 'a168', 'a169', 'a170', 'a171', 'a172', 'a173',
'a162', 'a174', 'a175', 'a176', 'a177', 'a178', 'a179', 'a193', 'a180',
'a199', 'a181', 'a200', 'a182', '', 'a201', 'a183', 'a184', 'a197', 'a185',
'a194', 'a198', 'a186', 'a195', 'a187', 'a188', 'a189', 'a190', 'a191'];
function getEncoding(encodingName) {
switch (encodingName) {
case 'WinAnsiEncoding':
return WinAnsiEncoding;
case 'StandardEncoding':
return StandardEncoding;
case 'MacRomanEncoding':
return MacRomanEncoding;
case 'SymbolSetEncoding':
return SymbolSetEncoding;
case 'ZapfDingbatsEncoding':
return ZapfDingbatsEncoding;
case 'ExpertEncoding':
return ExpertEncoding;
case 'MacExpertEncoding':
return MacExpertEncoding;
default:
return null;
}
}
exports.WinAnsiEncoding = WinAnsiEncoding;
exports.StandardEncoding = StandardEncoding;
exports.MacRomanEncoding = MacRomanEncoding;
exports.SymbolSetEncoding = SymbolSetEncoding;
exports.ZapfDingbatsEncoding = ZapfDingbatsEncoding;
exports.ExpertEncoding = ExpertEncoding;
exports.getEncoding = getEncoding;
}));

View File

@ -22,23 +22,30 @@
'pdfjs/core/primitives', 'pdfjs/core/stream', 'pdfjs/core/parser',
'pdfjs/core/image', 'pdfjs/core/colorspace', 'pdfjs/core/murmurhash3',
'pdfjs/core/fonts', 'pdfjs/core/function', 'pdfjs/core/pattern',
'pdfjs/core/cmap', 'pdfjs/core/metrics', 'pdfjs/core/bidi'], factory);
'pdfjs/core/cmap', 'pdfjs/core/metrics', 'pdfjs/core/bidi',
'pdfjs/core/encodings', 'pdfjs/core/standard_fonts',
'pdfjs/core/unicode'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./primitives.js'),
require('./stream.js'), require('./parser.js'), require('./image.js'),
require('./colorspace.js'), require('./murmurhash3.js'),
require('./fonts.js'), require('./function.js'), require('./pattern.js'),
require('./cmap.js'), require('./metrics.js'), require('./bidi.js'));
require('./cmap.js'), require('./metrics.js'), require('./bidi.js'),
require('./encodings.js'), require('./standard_fonts.js'),
require('./unicode.js'));
} else {
factory((root.pdfjsCoreEvaluator = {}), root.pdfjsSharedUtil,
root.pdfjsCorePrimitives, root.pdfjsCoreStream, root.pdfjsCoreParser,
root.pdfjsCoreImage, root.pdfjsCoreColorSpace, root.pdfjsCoreMurmurHash3,
root.pdfjsCoreFonts, root.pdfjsCoreFunction, root.pdfjsCorePattern,
root.pdfjsCoreCMap, root.pdfjsCoreMetrics, root.pdfjsCoreBidi);
root.pdfjsCoreCMap, root.pdfjsCoreMetrics, root.pdfjsCoreBidi,
root.pdfjsCoreEncodings, root.pdfjsCoreStandardFonts,
root.pdfjsCoreUnicode);
}
}(this, function (exports, sharedUtil, corePrimitives, coreStream, coreParser,
coreImage, coreColorSpace, coreMurmurHash3, coreFonts,
coreFunction, corePattern, coreCMap, coreMetrics, coreBidi) {
coreFunction, corePattern, coreCMap, coreMetrics, coreBidi,
coreEncodings, coreStandardFonts, coreUnicode) {
var FONT_IDENTITY_MATRIX = sharedUtil.FONT_IDENTITY_MATRIX;
var IDENTITY_MATRIX = sharedUtil.IDENTITY_MATRIX;
@ -54,6 +61,7 @@ var info = sharedUtil.info;
var isArray = sharedUtil.isArray;
var isNum = sharedUtil.isNum;
var isString = sharedUtil.isString;
var getLookupTableFactory = sharedUtil.getLookupTableFactory;
var warn = sharedUtil.warn;
var Dict = corePrimitives.Dict;
var Name = corePrimitives.Name;
@ -70,26 +78,31 @@ var isEOF = coreParser.isEOF;
var PDFImage = coreImage.PDFImage;
var ColorSpace = coreColorSpace.ColorSpace;
var MurmurHash3_64 = coreMurmurHash3.MurmurHash3_64;
var Encodings = coreFonts.Encodings;
var ErrorFont = coreFonts.ErrorFont;
var FontFlags = coreFonts.FontFlags;
var Font = coreFonts.Font;
var IdentityToUnicodeMap = coreFonts.IdentityToUnicodeMap;
var NormalizedUnicodes = coreFonts.NormalizedUnicodes;
var ToUnicodeMap = coreFonts.ToUnicodeMap;
var getFontType = coreFonts.getFontType;
var reverseIfRtl = coreFonts.reverseIfRtl;
var serifFonts = coreFonts.serifFonts;
var symbolsFonts = coreFonts.symbolsFonts;
var stdFontMap = coreFonts.stdFontMap;
var isPDFFunction = coreFunction.isPDFFunction;
var PDFFunction = coreFunction.PDFFunction;
var Pattern = corePattern.Pattern;
var getTilingPatternIR = corePattern.getTilingPatternIR;
var CMapFactory = coreCMap.CMapFactory;
var IdentityCMap = coreCMap.IdentityCMap;
var Metrics = coreMetrics.Metrics;
var getMetrics = coreMetrics.getMetrics;
var bidi = coreBidi.bidi;
var WinAnsiEncoding = coreEncodings.WinAnsiEncoding;
var StandardEncoding = coreEncodings.StandardEncoding;
var MacRomanEncoding = coreEncodings.MacRomanEncoding;
var SymbolSetEncoding = coreEncodings.SymbolSetEncoding;
var ZapfDingbatsEncoding = coreEncodings.ZapfDingbatsEncoding;
var getEncoding = coreEncodings.getEncoding;
var getStdFontMap = coreStandardFonts.getStdFontMap;
var getSerifFonts = coreStandardFonts.getSerifFonts;
var getSymbolsFonts = coreStandardFonts.getSymbolsFonts;
var getNormalizedUnicodes = coreUnicode.getNormalizedUnicodes;
var reverseIfRtl = coreUnicode.reverseIfRtl;
var PartialEvaluator = (function PartialEvaluatorClosure() {
function PartialEvaluator(pdfManager, xref, handler, pageIndex,
@ -718,7 +731,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var self = this;
var xref = this.xref;
var imageCache = {};
var imageCache = Object.create(null);
assert(operatorList);
@ -1041,7 +1054,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// The xobj is parsed iff it's needed, e.g. if there is a `DO` cmd.
var xobjs = null;
var xobjsCache = {};
var xobjsCache = Object.create(null);
var preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);
@ -1183,6 +1196,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
var glyphUnicode = glyph.unicode;
var NormalizedUnicodes = getNormalizedUnicodes();
if (NormalizedUnicodes[glyphUnicode] !== undefined) {
glyphUnicode = NormalizedUnicodes[glyphUnicode];
}
@ -1580,19 +1594,19 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}
if (baseEncodingName) {
properties.defaultEncoding = Encodings[baseEncodingName].slice();
properties.defaultEncoding = getEncoding(baseEncodingName).slice();
} else {
encoding = (properties.type === 'TrueType' ?
Encodings.WinAnsiEncoding : Encodings.StandardEncoding);
WinAnsiEncoding : StandardEncoding);
// The Symbolic attribute can be misused for regular fonts
// Heuristic: we have to check if the font is a standard one also
if (!!(properties.flags & FontFlags.Symbolic)) {
encoding = Encodings.MacRomanEncoding;
encoding = MacRomanEncoding;
if (!properties.file) {
if (/Symbol/i.test(properties.name)) {
encoding = Encodings.SymbolSetEncoding;
encoding = SymbolSetEncoding;
} else if (/Dingbats/i.test(properties.name)) {
encoding = Encodings.ZapfDingbatsEncoding;
encoding = ZapfDingbatsEncoding;
}
}
}
@ -1761,7 +1775,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
isSerifFont: function PartialEvaluator_isSerifFont(baseFontName) {
// Simulating descriptor flags attribute
var fontNameWoStyle = baseFontName.split('-')[0];
return (fontNameWoStyle in serifFonts) ||
return (fontNameWoStyle in getSerifFonts()) ||
(fontNameWoStyle.search(/serif/gi) !== -1);
},
@ -1769,7 +1783,9 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var defaultWidth = 0;
var widths = [];
var monospace = false;
var stdFontMap = getStdFontMap();
var lookupName = (stdFontMap[name] || name);
var Metrics = getMetrics();
if (!(lookupName in Metrics)) {
// Use default fonts for looking up font metrics if the passed
@ -1786,7 +1802,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
defaultWidth = glyphWidths;
monospace = true;
} else {
widths = glyphWidths;
widths = glyphWidths(); // expand lazy widths array
}
return {
@ -1929,8 +1945,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var flags =
(this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) |
(metrics.monospace ? FontFlags.FixedPitch : 0) |
(symbolsFonts[fontNameWoStyle] ? FontFlags.Symbolic :
FontFlags.Nonsymbolic);
(getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic :
FontFlags.Nonsymbolic);
properties = {
type: type,
@ -2077,7 +2093,7 @@ var TranslatedFont = (function TranslatedFontClosure() {
var charProcs = this.dict.get('CharProcs').getAll();
var fontResources = this.dict.get('Resources') || resources;
var charProcKeys = Object.keys(charProcs);
var charProcOperatorList = {};
var charProcOperatorList = Object.create(null);
for (var i = 0, n = charProcKeys.length; i < n; ++i) {
loadCharProcsPromise = loadCharProcsPromise.then(function (key) {
var glyphStream = charProcs[key];
@ -2131,7 +2147,7 @@ var OperatorList = (function OperatorListClosure() {
this.messageHandler = messageHandler;
this.fnArray = [];
this.argsArray = [];
this.dependencies = {};
this.dependencies = Object.create(null);
this._totalLength = 0;
this.pageIndex = pageIndex;
this.intent = intent;
@ -2211,7 +2227,7 @@ var OperatorList = (function OperatorListClosure() {
pageIndex: this.pageIndex,
intent: this.intent
}, transfers);
this.dependencies = {};
this.dependencies = Object.create(null);
this.fnArray.length = 0;
this.argsArray.length = 0;
}
@ -2321,119 +2337,121 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
//
// If variableArgs === true: [0, `numArgs`] expected
// If variableArgs === false: exactly `numArgs` expected
var OP_MAP = {
var getOPMap = getLookupTableFactory(function (t) {
// Graphic state
w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false },
J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false },
j: { id: OPS.setLineJoin, numArgs: 1, variableArgs: false },
M: { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false },
d: { id: OPS.setDash, numArgs: 2, variableArgs: false },
ri: { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false },
i: { id: OPS.setFlatness, numArgs: 1, variableArgs: false },
gs: { id: OPS.setGState, numArgs: 1, variableArgs: false },
q: { id: OPS.save, numArgs: 0, variableArgs: false },
Q: { id: OPS.restore, numArgs: 0, variableArgs: false },
cm: { id: OPS.transform, numArgs: 6, variableArgs: false },
t['w'] = { id: OPS.setLineWidth, numArgs: 1, variableArgs: false };
t['J'] = { id: OPS.setLineCap, numArgs: 1, variableArgs: false };
t['j'] = { id: OPS.setLineJoin, numArgs: 1, variableArgs: false };
t['M'] = { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false };
t['d'] = { id: OPS.setDash, numArgs: 2, variableArgs: false };
t['ri'] = { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false };
t['i'] = { id: OPS.setFlatness, numArgs: 1, variableArgs: false };
t['gs'] = { id: OPS.setGState, numArgs: 1, variableArgs: false };
t['q'] = { id: OPS.save, numArgs: 0, variableArgs: false };
t['Q'] = { id: OPS.restore, numArgs: 0, variableArgs: false };
t['cm'] = { id: OPS.transform, numArgs: 6, variableArgs: false };
// Path
m: { id: OPS.moveTo, numArgs: 2, variableArgs: false },
l: { id: OPS.lineTo, numArgs: 2, variableArgs: false },
c: { id: OPS.curveTo, numArgs: 6, variableArgs: false },
v: { id: OPS.curveTo2, numArgs: 4, variableArgs: false },
y: { id: OPS.curveTo3, numArgs: 4, variableArgs: false },
h: { id: OPS.closePath, numArgs: 0, variableArgs: false },
re: { id: OPS.rectangle, numArgs: 4, variableArgs: false },
S: { id: OPS.stroke, numArgs: 0, variableArgs: false },
s: { id: OPS.closeStroke, numArgs: 0, variableArgs: false },
f: { id: OPS.fill, numArgs: 0, variableArgs: false },
F: { id: OPS.fill, numArgs: 0, variableArgs: false },
'f*': { id: OPS.eoFill, numArgs: 0, variableArgs: false },
B: { id: OPS.fillStroke, numArgs: 0, variableArgs: false },
'B*': { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false },
b: { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false },
'b*': { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false },
n: { id: OPS.endPath, numArgs: 0, variableArgs: false },
t['m'] = { id: OPS.moveTo, numArgs: 2, variableArgs: false };
t['l'] = { id: OPS.lineTo, numArgs: 2, variableArgs: false };
t['c'] = { id: OPS.curveTo, numArgs: 6, variableArgs: false };
t['v'] = { id: OPS.curveTo2, numArgs: 4, variableArgs: false };
t['y'] = { id: OPS.curveTo3, numArgs: 4, variableArgs: false };
t['h'] = { id: OPS.closePath, numArgs: 0, variableArgs: false };
t['re'] = { id: OPS.rectangle, numArgs: 4, variableArgs: false };
t['S'] = { id: OPS.stroke, numArgs: 0, variableArgs: false };
t['s'] = { id: OPS.closeStroke, numArgs: 0, variableArgs: false };
t['f'] = { id: OPS.fill, numArgs: 0, variableArgs: false };
t['F'] = { id: OPS.fill, numArgs: 0, variableArgs: false };
t['f*'] = { id: OPS.eoFill, numArgs: 0, variableArgs: false };
t['B'] = { id: OPS.fillStroke, numArgs: 0, variableArgs: false };
t['B*'] = { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false };
t['b'] = { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false };
t['b*'] = { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false };
t['n'] = { id: OPS.endPath, numArgs: 0, variableArgs: false };
// Clipping
W: { id: OPS.clip, numArgs: 0, variableArgs: false },
'W*': { id: OPS.eoClip, numArgs: 0, variableArgs: false },
t['W'] = { id: OPS.clip, numArgs: 0, variableArgs: false };
t['W*'] = { id: OPS.eoClip, numArgs: 0, variableArgs: false };
// Text
BT: { id: OPS.beginText, numArgs: 0, variableArgs: false },
ET: { id: OPS.endText, numArgs: 0, variableArgs: false },
Tc: { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false },
Tw: { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false },
Tz: { id: OPS.setHScale, numArgs: 1, variableArgs: false },
TL: { id: OPS.setLeading, numArgs: 1, variableArgs: false },
Tf: { id: OPS.setFont, numArgs: 2, variableArgs: false },
Tr: { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false },
Ts: { id: OPS.setTextRise, numArgs: 1, variableArgs: false },
Td: { id: OPS.moveText, numArgs: 2, variableArgs: false },
TD: { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false },
Tm: { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false },
'T*': { id: OPS.nextLine, numArgs: 0, variableArgs: false },
Tj: { id: OPS.showText, numArgs: 1, variableArgs: false },
TJ: { id: OPS.showSpacedText, numArgs: 1, variableArgs: false },
'\'': { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false },
'"': { id: OPS.nextLineSetSpacingShowText, numArgs: 3,
variableArgs: false },
t['BT'] = { id: OPS.beginText, numArgs: 0, variableArgs: false };
t['ET'] = { id: OPS.endText, numArgs: 0, variableArgs: false };
t['Tc'] = { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false };
t['Tw'] = { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false };
t['Tz'] = { id: OPS.setHScale, numArgs: 1, variableArgs: false };
t['TL'] = { id: OPS.setLeading, numArgs: 1, variableArgs: false };
t['Tf'] = { id: OPS.setFont, numArgs: 2, variableArgs: false };
t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false };
t['Ts'] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false };
t['Td'] = { id: OPS.moveText, numArgs: 2, variableArgs: false };
t['TD'] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false };
t['Tm'] = { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false };
t['T*'] = { id: OPS.nextLine, numArgs: 0, variableArgs: false };
t['Tj'] = { id: OPS.showText, numArgs: 1, variableArgs: false };
t['TJ'] = { id: OPS.showSpacedText, numArgs: 1, variableArgs: false };
t['\''] = { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false };
t['"'] = { id: OPS.nextLineSetSpacingShowText, numArgs: 3,
variableArgs: false };
// Type3 fonts
d0: { id: OPS.setCharWidth, numArgs: 2, variableArgs: false },
d1: { id: OPS.setCharWidthAndBounds, numArgs: 6, variableArgs: false },
t['d0'] = { id: OPS.setCharWidth, numArgs: 2, variableArgs: false };
t['d1'] = { id: OPS.setCharWidthAndBounds, numArgs: 6,
variableArgs: false };
// Color
CS: { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false },
cs: { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false },
SC: { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true },
SCN: { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true },
sc: { id: OPS.setFillColor, numArgs: 4, variableArgs: true },
scn: { id: OPS.setFillColorN, numArgs: 33, variableArgs: true },
G: { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false },
g: { id: OPS.setFillGray, numArgs: 1, variableArgs: false },
RG: { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false },
rg: { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false },
K: { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false },
k: { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false },
t['CS'] = { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false };
t['cs'] = { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false };
t['SC'] = { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true };
t['SCN'] = { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true };
t['sc'] = { id: OPS.setFillColor, numArgs: 4, variableArgs: true };
t['scn'] = { id: OPS.setFillColorN, numArgs: 33, variableArgs: true };
t['G'] = { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false };
t['g'] = { id: OPS.setFillGray, numArgs: 1, variableArgs: false };
t['RG'] = { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false };
t['rg'] = { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false };
t['K'] = { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false };
t['k'] = { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false };
// Shading
sh: { id: OPS.shadingFill, numArgs: 1, variableArgs: false },
t['sh'] = { id: OPS.shadingFill, numArgs: 1, variableArgs: false };
// Images
BI: { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false },
ID: { id: OPS.beginImageData, numArgs: 0, variableArgs: false },
EI: { id: OPS.endInlineImage, numArgs: 1, variableArgs: false },
t['BI'] = { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false };
t['ID'] = { id: OPS.beginImageData, numArgs: 0, variableArgs: false };
t['EI'] = { id: OPS.endInlineImage, numArgs: 1, variableArgs: false };
// XObjects
Do: { id: OPS.paintXObject, numArgs: 1, variableArgs: false },
MP: { id: OPS.markPoint, numArgs: 1, variableArgs: false },
DP: { id: OPS.markPointProps, numArgs: 2, variableArgs: false },
BMC: { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false },
BDC: { id: OPS.beginMarkedContentProps, numArgs: 2,
variableArgs: false },
EMC: { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false },
t['Do'] = { id: OPS.paintXObject, numArgs: 1, variableArgs: false };
t['MP'] = { id: OPS.markPoint, numArgs: 1, variableArgs: false };
t['DP'] = { id: OPS.markPointProps, numArgs: 2, variableArgs: false };
t['BMC'] = { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false };
t['BDC'] = { id: OPS.beginMarkedContentProps, numArgs: 2,
variableArgs: false };
t['EMC'] = { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false };
// Compatibility
BX: { id: OPS.beginCompat, numArgs: 0, variableArgs: false },
EX: { id: OPS.endCompat, numArgs: 0, variableArgs: false },
t['BX'] = { id: OPS.beginCompat, numArgs: 0, variableArgs: false };
t['EX'] = { id: OPS.endCompat, numArgs: 0, variableArgs: false };
// (reserved partial commands for the lexer)
BM: null,
BD: null,
'true': null,
fa: null,
fal: null,
fals: null,
'false': null,
nu: null,
nul: null,
'null': null
};
t['BM'] = null;
t['BD'] = null;
t['true'] = null;
t['fa'] = null;
t['fal'] = null;
t['fals'] = null;
t['false'] = null;
t['nu'] = null;
t['nul'] = null;
t['null'] = null;
});
function EvaluatorPreprocessor(stream, xref, stateManager) {
// TODO(mduan): pass array of knownCommands rather than OP_MAP
this.opMap = getOPMap();
// TODO(mduan): pass array of knownCommands rather than this.opMap
// dictionary
this.parser = new Parser(new Lexer(stream, OP_MAP), false, xref);
this.parser = new Parser(new Lexer(stream, this.opMap), false, xref);
this.stateManager = stateManager;
this.nonProcessedArgs = [];
}
@ -2471,7 +2489,7 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
if (isCmd(obj)) {
var cmd = obj.cmd;
// Check that the command is valid
var opSpec = OP_MAP[cmd];
var opSpec = this.opMap[cmd];
if (!opSpec) {
warn('Unknown command "' + cmd + '"');
continue;

View File

@ -17,25 +17,27 @@
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/font_renderer', ['exports', 'pdfjs/shared/util',
'pdfjs/core/stream', 'pdfjs/core/glyphlist'], factory);
'pdfjs/core/stream', 'pdfjs/core/glyphlist', 'pdfjs/core/encodings'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'), require('./stream.js'),
require('./glyphlist.js'));
require('./glyphlist.js'), require('./encodings.js'));
} else {
factory((root.pdfjsCoreFontRenderer = {}), root.pdfjsSharedUtil,
root.pdfjsCoreStream, root.pdfjsCoreGlyphList);
root.pdfjsCoreStream, root.pdfjsCoreGlyphList, root.pdfjsCoreEncodings);
}
}(this, function (exports, sharedUtil, coreStream, coreGlyphList) {
}(this, function (exports, sharedUtil, coreStream, coreGlyphList,
coreEncodings) {
var Util = sharedUtil.Util;
var bytesToString = sharedUtil.bytesToString;
var error = sharedUtil.error;
var Stream = coreStream.Stream;
var GlyphsUnicode = coreGlyphList.GlyphsUnicode;
var getGlyphsUnicode = coreGlyphList.getGlyphsUnicode;
var StandardEncoding = coreEncodings.StandardEncoding;
var coreFonts; // see _setCoreFonts below
var CFFParser; // = coreFonts.CFFParser;
var Encodings; // = coreFonts.Encodings;
var FontRendererFactory = (function FontRendererFactoryClosure() {
function getLong(data, offset) {
@ -450,12 +452,12 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
cmds.push({cmd: 'save'});
cmds.push({cmd: 'translate', args: [x, y]});
var gid = lookupCmap(font.cmap, String.fromCharCode(
font.glyphNameMap[Encodings.StandardEncoding[achar]]));
font.glyphNameMap[StandardEncoding[achar]]));
compileCharString(font.glyphs[gid], cmds, font);
cmds.push({cmd: 'restore'});
gid = lookupCmap(font.cmap, String.fromCharCode(
font.glyphNameMap[Encodings.StandardEncoding[bchar]]));
font.glyphNameMap[StandardEncoding[bchar]]));
compileCharString(font.glyphs[gid], cmds, font);
}
return;
@ -607,7 +609,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
var noop = '';
function CompiledFont(fontMatrix) {
this.compiledGlyphs = {};
this.compiledGlyphs = Object.create(null);
this.fontMatrix = fontMatrix;
}
CompiledFont.prototype = {
@ -670,7 +672,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
this.gsubrs = cffInfo.gsubrs || [];
this.subrs = cffInfo.subrs || [];
this.cmap = cmap;
this.glyphNameMap = glyphNameMap || GlyphsUnicode;
this.glyphNameMap = glyphNameMap || getGlyphsUnicode();
this.compiledGlyphs = [];
this.gsubrsBias = (this.gsubrs.length < 1240 ?
@ -731,7 +733,6 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
// TODO refactor to remove cyclic dependency on fonts.js
function _setCoreFonts(coreFonts_) {
coreFonts = coreFonts_;
Encodings = coreFonts_.Encodings;
CFFParser = coreFonts_.CFFParser;
}
exports._setCoreFonts = _setCoreFonts;

File diff suppressed because it is too large Load Diff

View File

@ -434,7 +434,7 @@ var PDFFunction = (function PDFFunctionClosure() {
var evaluator = new PostScriptEvaluator(code);
// Cache the values for a big speed up, the cache size is limited though
// since the number of possible values can be huge from a PS function.
var cache = {};
var cache = Object.create(null);
// The MAX_CACHE_SIZE is set to ~4x the maximum number of distinct values
// seen in our tests.
var MAX_CACHE_SIZE = 2048 * 4;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -52,8 +52,8 @@ var NetworkManager = (function NetworkManagerClosure() {
};
this.currXhrId = 0;
this.pendingRequests = {};
this.loadedRequests = {};
this.pendingRequests = Object.create(null);
this.loadedRequests = Object.create(null);
}
function getArrayBuffer(xhr) {

View File

@ -229,9 +229,6 @@ var Catalog = (function CatalogClosure() {
var nameTree = new NameTree(nameTreeRef, xref);
var names = nameTree.getAll();
for (var name in names) {
if (!names.hasOwnProperty(name)) {
continue;
}
dests[name] = fetchDestination(names[name]);
}
}
@ -291,7 +288,7 @@ var Catalog = (function CatalogClosure() {
var currentLabel = '', currentIndex = 1;
for (var i = 0, ii = this.numPages; i < ii; i++) {
if (nums.hasOwnProperty(i)) {
if (i in nums) {
var labelDict = nums[i];
assert(isDict(labelDict), 'The PageLabel is not a dictionary.');
@ -358,12 +355,9 @@ var Catalog = (function CatalogClosure() {
var nameTree = new NameTree(nameTreeRef, xref);
var names = nameTree.getAll();
for (var name in names) {
if (!names.hasOwnProperty(name)) {
continue;
}
var fs = new FileSpec(names[name], xref);
if (!attachments) {
attachments = {};
attachments = Object.create(null);
}
attachments[stringToPDFString(name)] = fs.serializable;
}
@ -392,9 +386,6 @@ var Catalog = (function CatalogClosure() {
var nameTree = new NameTree(obj.getRaw('JavaScript'), xref);
var names = nameTree.getAll();
for (var name in names) {
if (!names.hasOwnProperty(name)) {
continue;
}
// We don't really use the JavaScript right now. This code is
// defensive so we don't cause errors on document load.
var jsDict = names[name];
@ -595,7 +586,7 @@ var XRef = (function XRefClosure() {
function XRef(stream, password) {
this.stream = stream;
this.entries = [];
this.xrefstms = {};
this.xrefstms = Object.create(null);
// prepare the XRef cache
this.cache = [];
this.password = password;
@ -1232,7 +1223,7 @@ var NameOrNumberTree = (function NameOrNumberTreeClosure() {
NameOrNumberTree.prototype = {
getAll: function NameOrNumberTree_getAll() {
var dict = {};
var dict = Object.create(null);
if (!this.root) {
return dict;
}

View File

@ -70,7 +70,7 @@ var Parser = (function ParserClosure() {
this.lexer = lexer;
this.allowStreams = allowStreams;
this.xref = xref;
this.imageCache = {};
this.imageCache = Object.create(null);
this.refill();
}

View File

@ -35,7 +35,7 @@ var Name = (function NameClosure() {
Name.prototype = {};
var nameCache = {};
var nameCache = Object.create(null);
Name.get = function Name_get(name) {
var nameValue = nameCache[name];
@ -52,7 +52,7 @@ var Cmd = (function CmdClosure() {
Cmd.prototype = {};
var cmdCache = {};
var cmdCache = Object.create(null);
Cmd.get = function Cmd_get(cmd) {
var cmdValue = cmdCache[cmd];
@ -281,7 +281,7 @@ var Ref = (function RefClosure() {
// This structure stores only one instance of the reference.
var RefSet = (function RefSetClosure() {
function RefSet() {
this.dict = {};
this.dict = Object.create(null);
}
RefSet.prototype = {

View File

@ -126,7 +126,7 @@ var PostScriptToken = (function PostScriptTokenClosure() {
this.value = value;
}
var opCache = {};
var opCache = Object.create(null);
PostScriptToken.getOperator = function PostScriptToken_getOperator(op) {
var opValue = opCache[op];

370
src/core/standard_fonts.js Normal file
View File

@ -0,0 +1,370 @@
/* Copyright 2015 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs/core/standard_fonts', ['exports', 'pdfjs/shared/util'],
factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('../shared/util.js'));
} else {
factory((root.pdfjsCoreStandardFonts = {}), root.pdfjsSharedUtil);
}
}(this, function (exports, sharedUtil) {
var getLookupTableFactory = sharedUtil.getLookupTableFactory;
/**
* Hold a map of decoded fonts and of the standard fourteen Type1
* fonts and their acronyms.
*/
var getStdFontMap = getLookupTableFactory(function (t) {
t['ArialNarrow'] = 'Helvetica';
t['ArialNarrow-Bold'] = 'Helvetica-Bold';
t['ArialNarrow-BoldItalic'] = 'Helvetica-BoldOblique';
t['ArialNarrow-Italic'] = 'Helvetica-Oblique';
t['ArialBlack'] = 'Helvetica';
t['ArialBlack-Bold'] = 'Helvetica-Bold';
t['ArialBlack-BoldItalic'] = 'Helvetica-BoldOblique';
t['ArialBlack-Italic'] = 'Helvetica-Oblique';
t['Arial'] = 'Helvetica';
t['Arial-Bold'] = 'Helvetica-Bold';
t['Arial-BoldItalic'] = 'Helvetica-BoldOblique';
t['Arial-Italic'] = 'Helvetica-Oblique';
t['Arial-BoldItalicMT'] = 'Helvetica-BoldOblique';
t['Arial-BoldMT'] = 'Helvetica-Bold';
t['Arial-ItalicMT'] = 'Helvetica-Oblique';
t['ArialMT'] = 'Helvetica';
t['Courier-Bold'] = 'Courier-Bold';
t['Courier-BoldItalic'] = 'Courier-BoldOblique';
t['Courier-Italic'] = 'Courier-Oblique';
t['CourierNew'] = 'Courier';
t['CourierNew-Bold'] = 'Courier-Bold';
t['CourierNew-BoldItalic'] = 'Courier-BoldOblique';
t['CourierNew-Italic'] = 'Courier-Oblique';
t['CourierNewPS-BoldItalicMT'] = 'Courier-BoldOblique';
t['CourierNewPS-BoldMT'] = 'Courier-Bold';
t['CourierNewPS-ItalicMT'] = 'Courier-Oblique';
t['CourierNewPSMT'] = 'Courier';
t['Helvetica'] = 'Helvetica';
t['Helvetica-Bold'] = 'Helvetica-Bold';
t['Helvetica-BoldItalic'] = 'Helvetica-BoldOblique';
t['Helvetica-BoldOblique'] = 'Helvetica-BoldOblique';
t['Helvetica-Italic'] = 'Helvetica-Oblique';
t['Helvetica-Oblique'] = 'Helvetica-Oblique';
t['Symbol-Bold'] = 'Symbol';
t['Symbol-BoldItalic'] = 'Symbol';
t['Symbol-Italic'] = 'Symbol';
t['TimesNewRoman'] = 'Times-Roman';
t['TimesNewRoman-Bold'] = 'Times-Bold';
t['TimesNewRoman-BoldItalic'] = 'Times-BoldItalic';
t['TimesNewRoman-Italic'] = 'Times-Italic';
t['TimesNewRomanPS'] = 'Times-Roman';
t['TimesNewRomanPS-Bold'] = 'Times-Bold';
t['TimesNewRomanPS-BoldItalic'] = 'Times-BoldItalic';
t['TimesNewRomanPS-BoldItalicMT'] = 'Times-BoldItalic';
t['TimesNewRomanPS-BoldMT'] = 'Times-Bold';
t['TimesNewRomanPS-Italic'] = 'Times-Italic';
t['TimesNewRomanPS-ItalicMT'] = 'Times-Italic';
t['TimesNewRomanPSMT'] = 'Times-Roman';
t['TimesNewRomanPSMT-Bold'] = 'Times-Bold';
t['TimesNewRomanPSMT-BoldItalic'] = 'Times-BoldItalic';
t['TimesNewRomanPSMT-Italic'] = 'Times-Italic';
});
/**
* Holds the map of the non-standard fonts that might be included as
* a standard fonts without glyph data.
*/
var getNonStdFontMap = getLookupTableFactory(function (t) {
t['CenturyGothic'] = 'Helvetica';
t['CenturyGothic-Bold'] = 'Helvetica-Bold';
t['CenturyGothic-BoldItalic'] = 'Helvetica-BoldOblique';
t['CenturyGothic-Italic'] = 'Helvetica-Oblique';
t['ComicSansMS'] = 'Comic Sans MS';
t['ComicSansMS-Bold'] = 'Comic Sans MS-Bold';
t['ComicSansMS-BoldItalic'] = 'Comic Sans MS-BoldItalic';
t['ComicSansMS-Italic'] = 'Comic Sans MS-Italic';
t['LucidaConsole'] = 'Courier';
t['LucidaConsole-Bold'] = 'Courier-Bold';
t['LucidaConsole-BoldItalic'] = 'Courier-BoldOblique';
t['LucidaConsole-Italic'] = 'Courier-Oblique';
t['MS-Gothic'] = 'MS Gothic';
t['MS-Gothic-Bold'] = 'MS Gothic-Bold';
t['MS-Gothic-BoldItalic'] = 'MS Gothic-BoldItalic';
t['MS-Gothic-Italic'] = 'MS Gothic-Italic';
t['MS-Mincho'] = 'MS Mincho';
t['MS-Mincho-Bold'] = 'MS Mincho-Bold';
t['MS-Mincho-BoldItalic'] = 'MS Mincho-BoldItalic';
t['MS-Mincho-Italic'] = 'MS Mincho-Italic';
t['MS-PGothic'] = 'MS PGothic';
t['MS-PGothic-Bold'] = 'MS PGothic-Bold';
t['MS-PGothic-BoldItalic'] = 'MS PGothic-BoldItalic';
t['MS-PGothic-Italic'] = 'MS PGothic-Italic';
t['MS-PMincho'] = 'MS PMincho';
t['MS-PMincho-Bold'] = 'MS PMincho-Bold';
t['MS-PMincho-BoldItalic'] = 'MS PMincho-BoldItalic';
t['MS-PMincho-Italic'] = 'MS PMincho-Italic';
t['Wingdings'] = 'ZapfDingbats';
});
var getSerifFonts = getLookupTableFactory(function (t) {
t['Adobe Jenson'] = true;
t['Adobe Text'] = true;
t['Albertus'] = true;
t['Aldus'] = true;
t['Alexandria'] = true;
t['Algerian'] = true;
t['American Typewriter'] = true;
t['Antiqua'] = true;
t['Apex'] = true;
t['Arno'] = true;
t['Aster'] = true;
t['Aurora'] = true;
t['Baskerville'] = true;
t['Bell'] = true;
t['Bembo'] = true;
t['Bembo Schoolbook'] = true;
t['Benguiat'] = true;
t['Berkeley Old Style'] = true;
t['Bernhard Modern'] = true;
t['Berthold City'] = true;
t['Bodoni'] = true;
t['Bauer Bodoni'] = true;
t['Book Antiqua'] = true;
t['Bookman'] = true;
t['Bordeaux Roman'] = true;
t['Californian FB'] = true;
t['Calisto'] = true;
t['Calvert'] = true;
t['Capitals'] = true;
t['Cambria'] = true;
t['Cartier'] = true;
t['Caslon'] = true;
t['Catull'] = true;
t['Centaur'] = true;
t['Century Old Style'] = true;
t['Century Schoolbook'] = true;
t['Chaparral'] = true;
t['Charis SIL'] = true;
t['Cheltenham'] = true;
t['Cholla Slab'] = true;
t['Clarendon'] = true;
t['Clearface'] = true;
t['Cochin'] = true;
t['Colonna'] = true;
t['Computer Modern'] = true;
t['Concrete Roman'] = true;
t['Constantia'] = true;
t['Cooper Black'] = true;
t['Corona'] = true;
t['Ecotype'] = true;
t['Egyptienne'] = true;
t['Elephant'] = true;
t['Excelsior'] = true;
t['Fairfield'] = true;
t['FF Scala'] = true;
t['Folkard'] = true;
t['Footlight'] = true;
t['FreeSerif'] = true;
t['Friz Quadrata'] = true;
t['Garamond'] = true;
t['Gentium'] = true;
t['Georgia'] = true;
t['Gloucester'] = true;
t['Goudy Old Style'] = true;
t['Goudy Schoolbook'] = true;
t['Goudy Pro Font'] = true;
t['Granjon'] = true;
t['Guardian Egyptian'] = true;
t['Heather'] = true;
t['Hercules'] = true;
t['High Tower Text'] = true;
t['Hiroshige'] = true;
t['Hoefler Text'] = true;
t['Humana Serif'] = true;
t['Imprint'] = true;
t['Ionic No. 5'] = true;
t['Janson'] = true;
t['Joanna'] = true;
t['Korinna'] = true;
t['Lexicon'] = true;
t['Liberation Serif'] = true;
t['Linux Libertine'] = true;
t['Literaturnaya'] = true;
t['Lucida'] = true;
t['Lucida Bright'] = true;
t['Melior'] = true;
t['Memphis'] = true;
t['Miller'] = true;
t['Minion'] = true;
t['Modern'] = true;
t['Mona Lisa'] = true;
t['Mrs Eaves'] = true;
t['MS Serif'] = true;
t['Museo Slab'] = true;
t['New York'] = true;
t['Nimbus Roman'] = true;
t['NPS Rawlinson Roadway'] = true;
t['Palatino'] = true;
t['Perpetua'] = true;
t['Plantin'] = true;
t['Plantin Schoolbook'] = true;
t['Playbill'] = true;
t['Poor Richard'] = true;
t['Rawlinson Roadway'] = true;
t['Renault'] = true;
t['Requiem'] = true;
t['Rockwell'] = true;
t['Roman'] = true;
t['Rotis Serif'] = true;
t['Sabon'] = true;
t['Scala'] = true;
t['Seagull'] = true;
t['Sistina'] = true;
t['Souvenir'] = true;
t['STIX'] = true;
t['Stone Informal'] = true;
t['Stone Serif'] = true;
t['Sylfaen'] = true;
t['Times'] = true;
t['Trajan'] = true;
t['Trinité'] = true;
t['Trump Mediaeval'] = true;
t['Utopia'] = true;
t['Vale Type'] = true;
t['Bitstream Vera'] = true;
t['Vera Serif'] = true;
t['Versailles'] = true;
t['Wanted'] = true;
t['Weiss'] = true;
t['Wide Latin'] = true;
t['Windsor'] = true;
t['XITS'] = true;
});
var getSymbolsFonts = getLookupTableFactory(function (t) {
t['Dingbats'] = true;
t['Symbol'] = true;
t['ZapfDingbats'] = true;
});
// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID
// fonts, but does not embed the CID to GID mapping. The mapping is incomplete
// for all glyphs, but common for some set of the standard fonts.
var getGlyphMapForStandardFonts = getLookupTableFactory(function (t) {
t[2] = 10; t[3] = 32; t[4] = 33; t[5] = 34; t[6] = 35; t[7] = 36; t[8] = 37;
t[9] = 38; t[10] = 39; t[11] = 40; t[12] = 41; t[13] = 42; t[14] = 43;
t[15] = 44; t[16] = 45; t[17] = 46; t[18] = 47; t[19] = 48; t[20] = 49;
t[21] = 50; t[22] = 51; t[23] = 52; t[24] = 53; t[25] = 54; t[26] = 55;
t[27] = 56; t[28] = 57; t[29] = 58; t[30] = 894; t[31] = 60; t[32] = 61;
t[33] = 62; t[34] = 63; t[35] = 64; t[36] = 65; t[37] = 66; t[38] = 67;
t[39] = 68; t[40] = 69; t[41] = 70; t[42] = 71; t[43] = 72; t[44] = 73;
t[45] = 74; t[46] = 75; t[47] = 76; t[48] = 77; t[49] = 78; t[50] = 79;
t[51] = 80; t[52] = 81; t[53] = 82; t[54] = 83; t[55] = 84; t[56] = 85;
t[57] = 86; t[58] = 87; t[59] = 88; t[60] = 89; t[61] = 90; t[62] = 91;
t[63] = 92; t[64] = 93; t[65] = 94; t[66] = 95; t[67] = 96; t[68] = 97;
t[69] = 98; t[70] = 99; t[71] = 100; t[72] = 101; t[73] = 102; t[74] = 103;
t[75] = 104; t[76] = 105; t[77] = 106; t[78] = 107; t[79] = 108;
t[80] = 109; t[81] = 110; t[82] = 111; t[83] = 112; t[84] = 113;
t[85] = 114; t[86] = 115; t[87] = 116; t[88] = 117; t[89] = 118;
t[90] = 119; t[91] = 120; t[92] = 121; t[93] = 122; t[94] = 123;
t[95] = 124; t[96] = 125; t[97] = 126; t[98] = 196; t[99] = 197;
t[100] = 199; t[101] = 201; t[102] = 209; t[103] = 214; t[104] = 220;
t[105] = 225; t[106] = 224; t[107] = 226; t[108] = 228; t[109] = 227;
t[110] = 229; t[111] = 231; t[112] = 233; t[113] = 232; t[114] = 234;
t[115] = 235; t[116] = 237; t[117] = 236; t[118] = 238; t[119] = 239;
t[120] = 241; t[121] = 243; t[122] = 242; t[123] = 244; t[124] = 246;
t[125] = 245; t[126] = 250; t[127] = 249; t[128] = 251; t[129] = 252;
t[130] = 8224; t[131] = 176; t[132] = 162; t[133] = 163; t[134] = 167;
t[135] = 8226; t[136] = 182; t[137] = 223; t[138] = 174; t[139] = 169;
t[140] = 8482; t[141] = 180; t[142] = 168; t[143] = 8800; t[144] = 198;
t[145] = 216; t[146] = 8734; t[147] = 177; t[148] = 8804; t[149] = 8805;
t[150] = 165; t[151] = 181; t[152] = 8706; t[153] = 8721; t[154] = 8719;
t[156] = 8747; t[157] = 170; t[158] = 186; t[159] = 8486; t[160] = 230;
t[161] = 248; t[162] = 191; t[163] = 161; t[164] = 172; t[165] = 8730;
t[166] = 402; t[167] = 8776; t[168] = 8710; t[169] = 171; t[170] = 187;
t[171] = 8230; t[210] = 218; t[223] = 711; t[224] = 321; t[225] = 322;
t[227] = 353; t[229] = 382; t[234] = 253; t[252] = 263; t[253] = 268;
t[254] = 269; t[258] = 258; t[260] = 260; t[261] = 261; t[265] = 280;
t[266] = 281; t[268] = 283; t[269] = 313; t[275] = 323; t[276] = 324;
t[278] = 328; t[284] = 345; t[285] = 346; t[286] = 347; t[292] = 367;
t[295] = 377; t[296] = 378; t[298] = 380; t[305] = 963; t[306] = 964;
t[307] = 966; t[308] = 8215; t[309] = 8252; t[310] = 8319; t[311] = 8359;
t[312] = 8592; t[313] = 8593; t[337] = 9552; t[493] = 1039;
t[494] = 1040; t[705] = 1524; t[706] = 8362; t[710] = 64288; t[711] = 64298;
t[759] = 1617; t[761] = 1776; t[763] = 1778; t[775] = 1652; t[777] = 1764;
t[778] = 1780; t[779] = 1781; t[780] = 1782; t[782] = 771; t[783] = 64726;
t[786] = 8363; t[788] = 8532; t[790] = 768; t[791] = 769; t[792] = 768;
t[795] = 803; t[797] = 64336; t[798] = 64337; t[799] = 64342;
t[800] = 64343; t[801] = 64344; t[802] = 64345; t[803] = 64362;
t[804] = 64363; t[805] = 64364; t[2424] = 7821; t[2425] = 7822;
t[2426] = 7823; t[2427] = 7824; t[2428] = 7825; t[2429] = 7826;
t[2430] = 7827; t[2433] = 7682; t[2678] = 8045; t[2679] = 8046;
t[2830] = 1552; t[2838] = 686; t[2840] = 751; t[2842] = 753; t[2843] = 754;
t[2844] = 755; t[2846] = 757; t[2856] = 767; t[2857] = 848; t[2858] = 849;
t[2862] = 853; t[2863] = 854; t[2864] = 855; t[2865] = 861; t[2866] = 862;
t[2906] = 7460; t[2908] = 7462; t[2909] = 7463; t[2910] = 7464;
t[2912] = 7466; t[2913] = 7467; t[2914] = 7468; t[2916] = 7470;
t[2917] = 7471; t[2918] = 7472; t[2920] = 7474; t[2921] = 7475;
t[2922] = 7476; t[2924] = 7478; t[2925] = 7479; t[2926] = 7480;
t[2928] = 7482; t[2929] = 7483; t[2930] = 7484; t[2932] = 7486;
t[2933] = 7487; t[2934] = 7488; t[2936] = 7490; t[2937] = 7491;
t[2938] = 7492; t[2940] = 7494; t[2941] = 7495; t[2942] = 7496;
t[2944] = 7498; t[2946] = 7500; t[2948] = 7502; t[2950] = 7504;
t[2951] = 7505; t[2952] = 7506; t[2954] = 7508; t[2955] = 7509;
t[2956] = 7510; t[2958] = 7512; t[2959] = 7513; t[2960] = 7514;
t[2962] = 7516; t[2963] = 7517; t[2964] = 7518; t[2966] = 7520;
t[2967] = 7521; t[2968] = 7522; t[2970] = 7524; t[2971] = 7525;
t[2972] = 7526; t[2974] = 7528; t[2975] = 7529; t[2976] = 7530;
t[2978] = 1537; t[2979] = 1538; t[2980] = 1539; t[2982] = 1549;
t[2983] = 1551; t[2984] = 1552; t[2986] = 1554; t[2987] = 1555;
t[2988] = 1556; t[2990] = 1623; t[2991] = 1624; t[2995] = 1775;
t[2999] = 1791; t[3002] = 64290; t[3003] = 64291; t[3004] = 64292;
t[3006] = 64294; t[3007] = 64295; t[3008] = 64296; t[3011] = 1900;
t[3014] = 8223; t[3015] = 8244; t[3017] = 7532; t[3018] = 7533;
t[3019] = 7534; t[3075] = 7590; t[3076] = 7591; t[3079] = 7594;
t[3080] = 7595; t[3083] = 7598; t[3084] = 7599; t[3087] = 7602;
t[3088] = 7603; t[3091] = 7606; t[3092] = 7607; t[3095] = 7610;
t[3096] = 7611; t[3099] = 7614; t[3100] = 7615; t[3103] = 7618;
t[3104] = 7619; t[3107] = 8337; t[3108] = 8338; t[3116] = 1884;
t[3119] = 1885; t[3120] = 1885; t[3123] = 1886; t[3124] = 1886;
t[3127] = 1887; t[3128] = 1887; t[3131] = 1888; t[3132] = 1888;
t[3135] = 1889; t[3136] = 1889; t[3139] = 1890; t[3140] = 1890;
t[3143] = 1891; t[3144] = 1891; t[3147] = 1892; t[3148] = 1892;
t[3153] = 580; t[3154] = 581; t[3157] = 584; t[3158] = 585; t[3161] = 588;
t[3162] = 589; t[3165] = 891; t[3166] = 892; t[3169] = 1274; t[3170] = 1275;
t[3173] = 1278; t[3174] = 1279; t[3181] = 7622; t[3182] = 7623;
t[3282] = 11799; t[3316] = 578; t[3379] = 42785; t[3393] = 1159;
t[3416] = 8377;
});
// The glyph map for ArialBlack differs slightly from the glyph map used for
// other well-known standard fonts. Hence we use this (incomplete) CID to GID
// mapping to adjust the glyph map for non-embedded ArialBlack fonts.
var getSupplementalGlyphMapForArialBlack =
getLookupTableFactory(function (t) {
t[227] = 322; t[264] = 261; t[291] = 346;
});
exports.getStdFontMap = getStdFontMap;
exports.getNonStdFontMap = getNonStdFontMap;
exports.getSerifFonts = getSerifFonts;
exports.getSymbolsFonts = getSymbolsFonts;
exports.getGlyphMapForStandardFonts = getGlyphMapForStandardFonts;
exports.getSupplementalGlyphMapForArialBlack =
getSupplementalGlyphMapForArialBlack;
}));

1615
src/core/unicode.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -872,7 +872,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
this.objs = new PDFObjects();
this.cleanupAfterRender = false;
this.pendingCleanup = false;
this.intentStates = {};
this.intentStates = Object.create(null);
this.destroyed = false;
}
PDFPageProxy.prototype = /** @lends PDFPageProxy.prototype */ {
@ -947,7 +947,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
var renderingIntent = (params.intent === 'print' ? 'print' : 'display');
if (!this.intentStates[renderingIntent]) {
this.intentStates[renderingIntent] = {};
this.intentStates[renderingIntent] = Object.create(null);
}
var intentState = this.intentStates[renderingIntent];
@ -1039,7 +1039,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
var renderingIntent = 'oplist';
if (!this.intentStates[renderingIntent]) {
this.intentStates[renderingIntent] = {};
this.intentStates[renderingIntent] = Object.create(null);
}
var intentState = this.intentStates[renderingIntent];
@ -1886,7 +1886,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
*/
var PDFObjects = (function PDFObjectsClosure() {
function PDFObjects() {
this.objs = {};
this.objs = Object.create(null);
}
PDFObjects.prototype = {
@ -1977,7 +1977,7 @@ var PDFObjects = (function PDFObjectsClosure() {
},
clear: function PDFObjects_clear() {
this.objs = {};
this.objs = Object.create(null);
}
};
return PDFObjects;

View File

@ -39,7 +39,7 @@ var CustomStyle = (function CustomStyleClosure() {
// in some versions of IE9 it is critical that ms appear in this list
// before Moz
var prefixes = ['ms', 'Moz', 'Webkit', 'O'];
var _cache = {};
var _cache = Object.create(null);
function CustomStyle() {}

View File

@ -340,7 +340,7 @@ Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', {
var FontFaceObject = (function FontFaceObjectClosure() {
function FontFaceObject(translatedData) {
this.compiledGlyphs = {};
this.compiledGlyphs = Object.create(null);
// importing translated data
for (var i in translatedData) {
this[i] = translatedData[i];

View File

@ -58,7 +58,7 @@ var Metadata = PDFJS.Metadata = (function MetadataClosure() {
}
this.metaDocument = meta;
this.metadata = {};
this.metadata = Object.create(null);
this.parse();
}

View File

@ -385,7 +385,7 @@ var SVGGraphics = (function SVGGraphicsClosure() {
this.pendingEOFill = false;
this.embedFonts = false;
this.embeddedFonts = {};
this.embeddedFonts = Object.create(null);
this.cssStyle = null;
}

View File

@ -362,6 +362,18 @@ function shadow(obj, prop, value) {
}
PDFJS.shadow = shadow;
function getLookupTableFactory(initializer) {
var lookup;
return function () {
if (initializer) {
lookup = Object.create(null);
initializer(lookup);
initializer = null;
}
return lookup;
};
}
var LinkTarget = PDFJS.LinkTarget = {
NONE: 0, // Default value.
SELF: 1,
@ -1469,7 +1481,7 @@ var StatTimer = (function StatTimerClosure() {
return str;
}
function StatTimer() {
this.started = {};
this.started = Object.create(null);
this.times = [];
this.enabled = true;
}
@ -1563,8 +1575,8 @@ function MessageHandler(sourceName, targetName, comObj) {
this.comObj = comObj;
this.callbackIndex = 1;
this.postMessageTransfers = true;
var callbacksCapabilities = this.callbacksCapabilities = {};
var ah = this.actionHandler = {};
var callbacksCapabilities = this.callbacksCapabilities = Object.create(null);
var ah = this.actionHandler = Object.create(null);
this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) {
var data = event.data;
@ -2355,6 +2367,7 @@ exports.combineUrl = combineUrl;
exports.createPromiseCapability = createPromiseCapability;
exports.deprecated = deprecated;
exports.error = error;
exports.getLookupTableFactory = getLookupTableFactory;
exports.info = info;
exports.isArray = isArray;
exports.isArrayBuffer = isArrayBuffer;

View File

@ -165,7 +165,7 @@ var StepperManager = (function StepperManagerClosure() {
var stepperDiv = null;
var stepperControls = null;
var stepperChooser = null;
var breakPoints = {};
var breakPoints = Object.create(null);
return {
// Properties/functions needed by PDFBug.
id: 'Stepper',

View File

@ -34,7 +34,7 @@ var PDFFindController = (function PDFFindControllerClosure() {
function PDFFindController(options) {
this.startedTextExtraction = false;
this.extractTextPromises = [];
this.pendingFindMatches = {};
this.pendingFindMatches = Object.create(null);
this.active = false; // If active, find results will be highlighted.
this.pageContents = []; // Stores the text for each page.
this.pageMatches = [];