mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Add // prettier-ignore
comments to prevent re-formatting of certain data structures
There's a fair number of (primarily) `Array`s/`TypedArray`s whose formatting we don't want disturb, since in many cases that would lead to the code becoming much more difficult to read and/or break existing inline comments. *Please note:* It may be a good idea to look through these cases individually, and possibly re-write some of the them (especially the `String` ones) to reduce the need for all of these ignore commands.
This commit is contained in:
parent
c3a1c67950
commit
8ec1dfde49
25 changed files with 130 additions and 3 deletions
|
@ -17,6 +17,7 @@ import { warn } from '../shared/util';
|
|||
|
||||
// Character types for symbols from 0000 to 00FF.
|
||||
// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt
|
||||
// prettier-ignore
|
||||
var baseTypes = [
|
||||
'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'S', 'B', 'S',
|
||||
'WS', 'B', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN', 'BN',
|
||||
|
@ -46,6 +47,7 @@ var baseTypes = [
|
|||
// http://unicode.org/charts/PDF/U0600.pdf), so we replace it with an
|
||||
// empty string and issue a warning if we encounter this character. The
|
||||
// empty string is required to properly index the items after it.
|
||||
// prettier-ignore
|
||||
var arabicTypes = [
|
||||
'AN', 'AN', 'AN', 'AN', 'AN', 'AN', 'ON', 'ON', 'AL', 'ET', 'ET', 'AL',
|
||||
'CS', 'AL', 'ON', 'ON', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM', 'NSM',
|
||||
|
|
|
@ -41,6 +41,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
const twoDimVertR3 = 7;
|
||||
const twoDimVertL3 = 8;
|
||||
|
||||
// prettier-ignore
|
||||
const twoDimTable = [
|
||||
[-1, -1], [-1, -1], // 000000x
|
||||
[7, twoDimVertL3], // 0000010
|
||||
|
@ -109,6 +110,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
[1, twoDimVert0], [1, twoDimVert0]
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const whiteTable1 = [
|
||||
[-1, -1], // 00000
|
||||
[12, ccittEOL], // 00001
|
||||
|
@ -131,6 +133,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
[12, 2560] // 11111
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const whiteTable2 = [
|
||||
[-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx
|
||||
[8, 29], [8, 29], // 00000010x
|
||||
|
@ -295,6 +298,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
[4, 7], [4, 7], [4, 7], [4, 7]
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const blackTable1 = [
|
||||
[-1, -1], [-1, -1], // 000000000000x
|
||||
[12, ccittEOL], [12, ccittEOL], // 000000000001x
|
||||
|
@ -356,6 +360,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
[10, 64], [10, 64], [10, 64], [10, 64]
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const blackTable2 = [
|
||||
[8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx
|
||||
[8, 13], [8, 13], [8, 13], [8, 13],
|
||||
|
@ -435,6 +440,7 @@ let CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
[7, 12], [7, 12], [7, 12], [7, 12]
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const blackTable3 = [
|
||||
[-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx
|
||||
[6, 9], // 000100
|
||||
|
|
|
@ -28,6 +28,7 @@ var MAX_SUBR_NESTING = 10;
|
|||
* The CFF class takes a Type1 file and wrap it into a
|
||||
* 'Compact Font Format' which itself embed Type2 charstrings.
|
||||
*/
|
||||
// prettier-ignore
|
||||
var CFFStandardStrings = [
|
||||
'.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', 'percent',
|
||||
'ampersand', 'quoteright', 'parenleft', 'parenright', 'asterisk', 'plus',
|
||||
|
@ -339,8 +340,9 @@ var CFFParser = (function CFFParserClosure() {
|
|||
function parseFloatOperand() {
|
||||
var str = '';
|
||||
var eof = 15;
|
||||
var lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8',
|
||||
'9', '.', 'E', 'E-', null, '-'];
|
||||
// prettier-ignore
|
||||
const lookup = ['0', '1', '2', '3', '4', '5', '6', '7', '8',
|
||||
'9', '.', 'E', 'E-', null, '-'];
|
||||
var length = dict.length;
|
||||
while (pos < length) {
|
||||
var b = dict[pos++];
|
||||
|
@ -1087,6 +1089,7 @@ var CFFTopDict = (function CFFTopDictClosure() {
|
|||
[[12, 4], 'UnderlineThickness', 'num', 50],
|
||||
[[12, 5], 'PaintType', 'num', 0],
|
||||
[[12, 6], 'CharstringType', 'num', 2],
|
||||
// prettier-ignore
|
||||
[[12, 7], 'FontMatrix', ['num', 'num', 'num', 'num', 'num', 'num'],
|
||||
[0.001, 0, 0, 0.001, 0, 0]],
|
||||
[13, 'UniqueID', 'num', null],
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
*/
|
||||
/* eslint no-var: error */
|
||||
|
||||
// prettier-ignore
|
||||
const ISOAdobeCharset = [
|
||||
'.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar',
|
||||
'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright',
|
||||
|
@ -51,6 +52,7 @@ const ISOAdobeCharset = [
|
|||
'ugrave', 'yacute', 'ydieresis', 'zcaron'
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const ExpertCharset = [
|
||||
'.notdef', 'space', 'exclamsmall', 'Hungarumlautsmall', 'dollaroldstyle',
|
||||
'dollarsuperior', 'ampersandsmall', 'Acutesmall', 'parenleftsuperior',
|
||||
|
@ -91,6 +93,7 @@ const ExpertCharset = [
|
|||
'Ydieresissmall'
|
||||
];
|
||||
|
||||
// prettier-ignore
|
||||
const ExpertSubsetCharset = [
|
||||
'.notdef', 'space', 'dollaroldstyle', 'dollarsuperior',
|
||||
'parenleftsuperior', 'parenrightsuperior', 'twodotenleader',
|
||||
|
|
|
@ -863,17 +863,20 @@ const CalGrayCS = (function CalGrayCSClosure() {
|
|||
const CalRGBCS = (function CalRGBCSClosure() {
|
||||
// See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for these
|
||||
// matrices.
|
||||
// prettier-ignore
|
||||
const BRADFORD_SCALE_MATRIX = new Float32Array([
|
||||
0.8951, 0.2664, -0.1614,
|
||||
-0.7502, 1.7135, 0.0367,
|
||||
0.0389, -0.0685, 1.0296]);
|
||||
|
||||
// prettier-ignore
|
||||
const BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([
|
||||
0.9869929, -0.1470543, 0.1599627,
|
||||
0.4323053, 0.5183603, 0.0492912,
|
||||
-0.0085287, 0.0400428, 0.9684867]);
|
||||
|
||||
// See http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html.
|
||||
// prettier-ignore
|
||||
const SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([
|
||||
3.2404542, -1.5371385, -0.4985314,
|
||||
-0.9692660, 1.8760108, 0.0415560,
|
||||
|
|
|
@ -87,6 +87,7 @@ function getInheritableProperty({ dict, key, getArray = false,
|
|||
return values;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
const ROMAN_NUMBER_MAP = [
|
||||
'', 'C', 'CC', 'CCC', 'CD', 'D', 'DC', 'DCC', 'DCCC', 'CM',
|
||||
'', 'X', 'XX', 'XXX', 'XL', 'L', 'LX', 'LXX', 'LXXX', 'XC',
|
||||
|
|
|
@ -63,12 +63,14 @@ var ARCFourCipher = (function ARCFourCipherClosure() {
|
|||
})();
|
||||
|
||||
var calculateMD5 = (function calculateMD5Closure() {
|
||||
// prettier-ignore
|
||||
var r = new Uint8Array([
|
||||
7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
|
||||
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
|
||||
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
|
||||
6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]);
|
||||
|
||||
// prettier-ignore
|
||||
var k = new Int32Array([
|
||||
-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426,
|
||||
-1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162,
|
||||
|
@ -136,6 +138,7 @@ var calculateMD5 = (function calculateMD5Closure() {
|
|||
h2 = (h2 + c) | 0;
|
||||
h3 = (h3 + d) | 0;
|
||||
}
|
||||
// prettier-ignore
|
||||
return new Uint8Array([
|
||||
h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >>> 24) & 0xFF,
|
||||
h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >>> 24) & 0xFF,
|
||||
|
@ -263,6 +266,7 @@ var calculateSHA256 = (function calculateSHA256Closure() {
|
|||
return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
var k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
|
||||
0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
|
||||
0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
|
||||
|
@ -341,6 +345,7 @@ var calculateSHA256 = (function calculateSHA256Closure() {
|
|||
h6 = (h6 + g) | 0;
|
||||
h7 = (h7 + h) | 0;
|
||||
}
|
||||
// prettier-ignore
|
||||
return new Uint8Array([
|
||||
(h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, (h0) & 0xFF,
|
||||
(h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, (h1) & 0xFF,
|
||||
|
@ -421,6 +426,7 @@ var calculateSHA512 = (function calculateSHA512Closure() {
|
|||
result.xor(tmp);
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
var k = [
|
||||
new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd),
|
||||
new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc),
|
||||
|
@ -635,6 +641,7 @@ class AESBaseCipher {
|
|||
unreachable('Cannot initialize AESBaseCipher.');
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
this._s = new Uint8Array([
|
||||
0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b,
|
||||
0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,
|
||||
|
@ -660,6 +667,7 @@ class AESBaseCipher {
|
|||
0xb0, 0x54, 0xbb, 0x16,
|
||||
]);
|
||||
|
||||
// prettier-ignore
|
||||
this._inv_s = new Uint8Array([
|
||||
0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e,
|
||||
0x81, 0xf3, 0xd7, 0xfb, 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87,
|
||||
|
@ -685,6 +693,7 @@ class AESBaseCipher {
|
|||
0x55, 0x21, 0x0c, 0x7d,
|
||||
]);
|
||||
|
||||
// prettier-ignore
|
||||
this._mix = new Uint32Array([
|
||||
0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927,
|
||||
0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45,
|
||||
|
@ -1040,6 +1049,7 @@ class AES128Cipher extends AESBaseCipher {
|
|||
this._cyclesOfRepetition = 10;
|
||||
this._keySize = 160; // bits
|
||||
|
||||
// prettier-ignore
|
||||
this._rcon = new Uint8Array([
|
||||
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,
|
||||
0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,
|
||||
|
@ -1373,6 +1383,7 @@ var CipherTransform = (function CipherTransformClosure() {
|
|||
})();
|
||||
|
||||
var CipherTransformFactory = (function CipherTransformFactoryClosure() {
|
||||
// prettier-ignore
|
||||
var defaultPasswordBytes = new Uint8Array([
|
||||
0x28, 0xBF, 0x4E, 0x5E, 0x4E, 0x75, 0x8A, 0x41,
|
||||
0x64, 0x00, 0x4E, 0x56, 0xFF, 0xFA, 0x01, 0x08,
|
||||
|
|
|
@ -345,6 +345,7 @@ class Page {
|
|||
}
|
||||
|
||||
const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2D]);
|
||||
// prettier-ignore
|
||||
const STARTXREF_SIGNATURE = new Uint8Array([
|
||||
0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]);
|
||||
const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6E, 0x64, 0x6F, 0x62, 0x6A]);
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
// prettier-ignore
|
||||
const ExpertEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
@ -56,6 +57,7 @@ const ExpertEncoding = [
|
|||
'Ucircumflexsmall', 'Udieresissmall', 'Yacutesmall', 'Thornsmall',
|
||||
'Ydieresissmall'];
|
||||
|
||||
// prettier-ignore
|
||||
const MacExpertEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
@ -98,6 +100,7 @@ const MacExpertEncoding = [
|
|||
'Macronsmall', 'bsuperior', 'nsuperior', 'msuperior', 'commasuperior',
|
||||
'periodsuperior', 'Dotaccentsmall', 'Ringsmall', '', '', '', ''];
|
||||
|
||||
// prettier-ignore
|
||||
const MacRomanEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
@ -134,6 +137,7 @@ const MacRomanEncoding = [
|
|||
'tilde', 'macron', 'breve', 'dotaccent', 'ring', 'cedilla', 'hungarumlaut',
|
||||
'ogonek', 'caron'];
|
||||
|
||||
// prettier-ignore
|
||||
const StandardEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
@ -162,6 +166,7 @@ const StandardEncoding = [
|
|||
'', '', '', 'dotlessi', '', '', 'lslash', 'oslash', 'oe', 'germandbls', '',
|
||||
'', '', ''];
|
||||
|
||||
// prettier-ignore
|
||||
const WinAnsiEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
@ -198,6 +203,7 @@ const WinAnsiEncoding = [
|
|||
'ugrave', 'uacute', 'ucircumflex', 'udieresis', 'yacute', 'thorn',
|
||||
'ydieresis'];
|
||||
|
||||
// prettier-ignore
|
||||
const SymbolSetEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
@ -236,6 +242,7 @@ const SymbolSetEncoding = [
|
|||
'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid',
|
||||
'bracerightbt', ''];
|
||||
|
||||
// prettier-ignore
|
||||
const ZapfDingbatsEncoding = [
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
'', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '',
|
||||
|
|
|
@ -2037,6 +2037,7 @@ var Font = (function FontClosure() {
|
|||
return names;
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
var TTOpsStackDeltas = [
|
||||
0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5,
|
||||
-1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1,
|
||||
|
|
|
@ -73,6 +73,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||
}
|
||||
|
||||
var sign = readBits(1);
|
||||
// prettier-ignore
|
||||
var value = readBits(1) ?
|
||||
(readBits(1) ?
|
||||
(readBits(1) ?
|
||||
|
|
|
@ -45,6 +45,7 @@ class EOIMarkerError extends BaseException { }
|
|||
*/
|
||||
|
||||
var JpegImage = (function JpegImageClosure() {
|
||||
// prettier-ignore
|
||||
var dctZigZag = new Uint8Array([
|
||||
0,
|
||||
1, 8,
|
||||
|
@ -1015,6 +1016,7 @@ var JpegImage = (function JpegImageClosure() {
|
|||
// inverting JPEG (CMYK) images if and only if the image data does *not*
|
||||
// come from a PDF file and no `decodeTransform` was passed by the user.
|
||||
if (!isSourcePDF && numComponents === 4 && !transform) {
|
||||
// prettier-ignore
|
||||
transform = new Int32Array([
|
||||
-256, 255, -256, 255, -256, 255, -256, 255]);
|
||||
}
|
||||
|
|
|
@ -1616,16 +1616,19 @@ var JpxImage = (function JpxImageClosure() {
|
|||
// Table D-1
|
||||
// The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4),
|
||||
// vv - sum of Vi (0..2), and hh - sum of Hi (0..2)
|
||||
// prettier-ignore
|
||||
var LLAndLHContextsLabel = new Uint8Array([
|
||||
0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4,
|
||||
7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6,
|
||||
8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8
|
||||
]);
|
||||
// prettier-ignore
|
||||
var HLContextLabel = new Uint8Array([
|
||||
0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8,
|
||||
8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3,
|
||||
4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8
|
||||
]);
|
||||
// prettier-ignore
|
||||
var HHContextLabel = new Uint8Array([
|
||||
0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5,
|
||||
5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8,
|
||||
|
|
|
@ -1377,8 +1377,9 @@ var XRef = (function XRefClosure() {
|
|||
const CHECK_CONTENT_LENGTH = 25;
|
||||
|
||||
var trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);
|
||||
// prettier-ignore
|
||||
var startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114,
|
||||
101, 102]);
|
||||
101, 102]);
|
||||
const objBytes = new Uint8Array([111, 98, 106]);
|
||||
var xrefBytes = new Uint8Array([47, 88, 82, 101, 102]);
|
||||
|
||||
|
|
|
@ -565,6 +565,7 @@ class Parser {
|
|||
this.shift(); // 'stream'
|
||||
} else {
|
||||
// Bad stream length, scanning for endstream command.
|
||||
// prettier-ignore
|
||||
const ENDSTREAM_SIGNATURE = new Uint8Array([
|
||||
0x65, 0x6E, 0x64, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6D]);
|
||||
let actualLength = this._findStreamLength(startPos,
|
||||
|
@ -724,6 +725,7 @@ class Parser {
|
|||
|
||||
// A '1' in this array means the character is white space. A '1' or
|
||||
// '2' means the character ends a name or command.
|
||||
// prettier-ignore
|
||||
const specialChars = [
|
||||
1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x
|
||||
|
|
|
@ -514,6 +514,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
}
|
||||
var tmp1, tmp2, tmp3, tmp4;
|
||||
switch (f) {
|
||||
// prettier-ignore
|
||||
case 0:
|
||||
ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6;
|
||||
ps[ 8] = pi + 2; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 7;
|
||||
|
@ -522,6 +523,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
cs[2] = ci + 1; cs[3] = ci + 2;
|
||||
cs[0] = ci; cs[1] = ci + 3;
|
||||
break;
|
||||
// prettier-ignore
|
||||
case 1:
|
||||
tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15];
|
||||
ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;
|
||||
|
@ -532,6 +534,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
cs[2] = tmp2; cs[3] = ci;
|
||||
cs[0] = tmp1; cs[1] = ci + 1;
|
||||
break;
|
||||
// prettier-ignore
|
||||
case 2:
|
||||
tmp1 = ps[15];
|
||||
tmp2 = ps[11];
|
||||
|
@ -543,6 +546,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
cs[2] = cs[1]; cs[3] = ci;
|
||||
cs[0] = tmp1; cs[1] = ci + 1;
|
||||
break;
|
||||
// prettier-ignore
|
||||
case 3:
|
||||
ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;
|
||||
ps[ 8] = ps[1]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3;
|
||||
|
@ -626,6 +630,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
}
|
||||
var tmp1, tmp2, tmp3, tmp4;
|
||||
switch (f) {
|
||||
// prettier-ignore
|
||||
case 0:
|
||||
ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6;
|
||||
ps[ 8] = pi + 2; ps[ 9] = pi + 13; ps[10] = pi + 14; ps[11] = pi + 7;
|
||||
|
@ -634,6 +639,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
cs[2] = ci + 1; cs[3] = ci + 2;
|
||||
cs[0] = ci; cs[1] = ci + 3;
|
||||
break;
|
||||
// prettier-ignore
|
||||
case 1:
|
||||
tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15];
|
||||
ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;
|
||||
|
@ -644,6 +650,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
cs[2] = tmp2; cs[3] = ci;
|
||||
cs[0] = tmp1; cs[1] = ci + 1;
|
||||
break;
|
||||
// prettier-ignore
|
||||
case 2:
|
||||
tmp1 = ps[15];
|
||||
tmp2 = ps[11];
|
||||
|
@ -655,6 +662,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
cs[2] = cs[1]; cs[3] = ci;
|
||||
cs[0] = tmp1; cs[1] = ci + 1;
|
||||
break;
|
||||
// prettier-ignore
|
||||
case 3:
|
||||
ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;
|
||||
ps[ 8] = ps[1]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3;
|
||||
|
|
|
@ -330,10 +330,12 @@ var StreamsSequenceStream = (function StreamsSequenceStreamClosure() {
|
|||
})();
|
||||
|
||||
var FlateStream = (function FlateStreamClosure() {
|
||||
// prettier-ignore
|
||||
var codeLenCodeMap = new Int32Array([
|
||||
16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15
|
||||
]);
|
||||
|
||||
// prettier-ignore
|
||||
var lengthDecode = new Int32Array([
|
||||
0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a,
|
||||
0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f,
|
||||
|
@ -341,6 +343,7 @@ var FlateStream = (function FlateStreamClosure() {
|
|||
0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102
|
||||
]);
|
||||
|
||||
// prettier-ignore
|
||||
var distDecode = new Int32Array([
|
||||
0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d,
|
||||
0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1,
|
||||
|
@ -348,6 +351,7 @@ var FlateStream = (function FlateStreamClosure() {
|
|||
0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001
|
||||
]);
|
||||
|
||||
// prettier-ignore
|
||||
var fixedLitCodeTab = [new Int32Array([
|
||||
0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0,
|
||||
0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0,
|
||||
|
@ -415,6 +419,7 @@ var FlateStream = (function FlateStreamClosure() {
|
|||
0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff
|
||||
]), 9];
|
||||
|
||||
// prettier-ignore
|
||||
var fixedDistCodeTab = [new Int32Array([
|
||||
0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c,
|
||||
0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000,
|
||||
|
|
|
@ -198,6 +198,7 @@ function compileType3Glyph(imgData) {
|
|||
var width = imgData.width, height = imgData.height;
|
||||
var i, j, j0, width1 = width + 1;
|
||||
var points = new Uint8Array(width1 * (height + 1));
|
||||
// prettier-ignore
|
||||
var POINT_TYPES =
|
||||
new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]);
|
||||
|
||||
|
|
|
@ -178,6 +178,7 @@ var WebGLUtils = (function WebGLUtilsClosure() {
|
|||
// provide texture coordinates for the rectangle.
|
||||
var texCoordBuffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, texCoordBuffer);
|
||||
// prettier-ignore
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
||||
0.0, 0.0,
|
||||
1.0, 0.0,
|
||||
|
@ -223,6 +224,7 @@ var WebGLUtils = (function WebGLUtilsClosure() {
|
|||
// it (2 triangles)
|
||||
var buffer = gl.createBuffer();
|
||||
gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
|
||||
// prettier-ignore
|
||||
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([
|
||||
0, 0,
|
||||
width, 0,
|
||||
|
|
|
@ -731,6 +731,7 @@ class Util {
|
|||
}
|
||||
}
|
||||
|
||||
// prettier-ignore
|
||||
const PDFStringTranslateTable = [
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0x2D8, 0x2C7, 0x2C6, 0x2D9, 0x2DD, 0x2DB, 0x2DA, 0x2DC, 0, 0, 0, 0, 0, 0, 0,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue