Merge pull request #531 from kkujala/master
Use lowercase properly in function names.
This commit is contained in:
commit
805fa3b291
@ -3,7 +3,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
var ARCFourCipher = (function aRCFourCipher() {
|
||||
var ARCFourCipher = (function arcFourCipher() {
|
||||
function constructor(key) {
|
||||
this.a = 0;
|
||||
this.b = 0;
|
||||
@ -21,7 +21,7 @@ var ARCFourCipher = (function aRCFourCipher() {
|
||||
}
|
||||
|
||||
constructor.prototype = {
|
||||
encryptBlock: function aRCFourCipherEncryptBlock(data) {
|
||||
encryptBlock: function arcFourCipherEncryptBlock(data) {
|
||||
var i, n = data.length, tmp, tmp2;
|
||||
var a = this.a, b = this.b, s = this.s;
|
||||
var output = new Uint8Array(n);
|
||||
@ -142,7 +142,7 @@ var NullCipher = (function nullCipher() {
|
||||
return constructor;
|
||||
})();
|
||||
|
||||
var AES128Cipher = (function aES128Cipher() {
|
||||
var AES128Cipher = (function aes128Cipher() {
|
||||
var 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,
|
||||
@ -372,7 +372,7 @@ var AES128Cipher = (function aES128Cipher() {
|
||||
}
|
||||
|
||||
constructor.prototype = {
|
||||
decryptBlock: function aES128CipherDecryptBlock(data) {
|
||||
decryptBlock: function aes128CipherDecryptBlock(data) {
|
||||
var i, sourceLength = data.length;
|
||||
var buffer = this.buffer, bufferLength = this.bufferPosition;
|
||||
// waiting for IV values -- they are at the start of the stream
|
||||
|
6
fonts.js
6
fonts.js
@ -2034,7 +2034,7 @@ var CFFStrings = [
|
||||
|
||||
var type1Parser = new Type1Parser();
|
||||
|
||||
var CFF = function cFF(name, file, properties) {
|
||||
var CFF = function cffCFF(name, file, properties) {
|
||||
// Get the data block containing glyphs and subrs informations
|
||||
var headerBlock = file.getBytes(properties.length1);
|
||||
type1Parser.extractFontHeader(headerBlock, properties);
|
||||
@ -2234,7 +2234,7 @@ CFF.prototype = {
|
||||
'names': this.createCFFIndexHeader([name]),
|
||||
|
||||
'topDict': (function topDict(self) {
|
||||
return function cFFWrapTopDict() {
|
||||
return function cffWrapTopDict() {
|
||||
var header = '\x00\x01\x01\x01';
|
||||
var dict =
|
||||
'\xf8\x1b\x00' + // version
|
||||
@ -2311,7 +2311,7 @@ CFF.prototype = {
|
||||
'charstrings': this.createCFFIndexHeader([[0x8B, 0x0E]].concat(glyphs),
|
||||
true),
|
||||
|
||||
'private': (function cFFWrapPrivate(self) {
|
||||
'private': (function cffWrapPrivate(self) {
|
||||
var data =
|
||||
'\x8b\x14' + // defaultWidth
|
||||
'\x8b\x15'; // nominalWidth
|
||||
|
60
pdf.js
60
pdf.js
@ -1134,7 +1134,7 @@ var AsciiHexStream = (function asciiHexStream() {
|
||||
return constructor;
|
||||
})();
|
||||
|
||||
var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
var CCITTFaxStream = (function ccittFaxStream() {
|
||||
|
||||
var ccittEOL = -2;
|
||||
var twoDimPass = 0;
|
||||
@ -1609,7 +1609,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
|
||||
constructor.prototype = Object.create(DecodeStream.prototype);
|
||||
|
||||
constructor.prototype.readBlock = function cCITTFaxStreamReadBlock() {
|
||||
constructor.prototype.readBlock = function ccittFaxStreamReadBlock() {
|
||||
while (!this.eof) {
|
||||
var c = this.lookChar();
|
||||
this.buf = EOF;
|
||||
@ -1619,7 +1619,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
};
|
||||
|
||||
constructor.prototype.addPixels =
|
||||
function cCITTFaxStreamAddPixels(a1, blackPixels) {
|
||||
function ccittFaxStreamAddPixels(a1, blackPixels) {
|
||||
var codingLine = this.codingLine;
|
||||
var codingPos = this.codingPos;
|
||||
|
||||
@ -1639,7 +1639,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
};
|
||||
|
||||
constructor.prototype.addPixelsNeg =
|
||||
function cCITTFaxStreamAddPixelsNeg(a1, blackPixels) {
|
||||
function ccittFaxStreamAddPixelsNeg(a1, blackPixels) {
|
||||
var codingLine = this.codingLine;
|
||||
var codingPos = this.codingPos;
|
||||
|
||||
@ -1667,7 +1667,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
this.codingPos = codingPos;
|
||||
};
|
||||
|
||||
constructor.prototype.lookChar = function cCITTFaxStreamLookChar() {
|
||||
constructor.prototype.lookChar = function ccittFaxStreamLookChar() {
|
||||
if (this.buf != EOF)
|
||||
return this.buf;
|
||||
|
||||
@ -1959,7 +1959,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
return this.buf;
|
||||
};
|
||||
|
||||
constructor.prototype.getTwoDimCode = function cCITTFaxStreamGetTwoDimCode() {
|
||||
constructor.prototype.getTwoDimCode = function ccittFaxStreamGetTwoDimCode() {
|
||||
var code = 0;
|
||||
var p;
|
||||
if (this.eoblock) {
|
||||
@ -1986,7 +1986,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
return EOF;
|
||||
};
|
||||
|
||||
constructor.prototype.getWhiteCode = function cCITTFaxStreamGetWhiteCode() {
|
||||
constructor.prototype.getWhiteCode = function ccittFaxStreamGetWhiteCode() {
|
||||
var code = 0;
|
||||
var p;
|
||||
var n;
|
||||
@ -2036,7 +2036,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
return 1;
|
||||
};
|
||||
|
||||
constructor.prototype.getBlackCode = function cCITTFaxStreamGetBlackCode() {
|
||||
constructor.prototype.getBlackCode = function ccittFaxStreamGetBlackCode() {
|
||||
var code, p;
|
||||
if (this.eoblock) {
|
||||
code = this.lookBits(13);
|
||||
@ -2099,7 +2099,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
return 1;
|
||||
};
|
||||
|
||||
constructor.prototype.lookBits = function cCITTFaxStreamLookBits(n) {
|
||||
constructor.prototype.lookBits = function ccittFaxStreamLookBits(n) {
|
||||
var c;
|
||||
while (this.inputBits < n) {
|
||||
if ((c = this.str.getByte()) == null) {
|
||||
@ -2114,7 +2114,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n));
|
||||
};
|
||||
|
||||
constructor.prototype.eatBits = function cCITTFaxStreamEatBits(n) {
|
||||
constructor.prototype.eatBits = function ccittFaxStreamEatBits(n) {
|
||||
if ((this.inputBits -= n) < 0)
|
||||
this.inputBits = 0;
|
||||
};
|
||||
@ -2122,7 +2122,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
|
||||
return constructor;
|
||||
})();
|
||||
|
||||
var LZWStream = (function lZWStream() {
|
||||
var LZWStream = (function lzwStream() {
|
||||
function constructor(str, earlyChange) {
|
||||
this.str = str;
|
||||
this.dict = str.dict;
|
||||
@ -2151,7 +2151,7 @@ var LZWStream = (function lZWStream() {
|
||||
|
||||
constructor.prototype = Object.create(DecodeStream.prototype);
|
||||
|
||||
constructor.prototype.readBits = function lZWStreamReadBits(n) {
|
||||
constructor.prototype.readBits = function lzwStreamReadBits(n) {
|
||||
var bitsCached = this.bitsCached;
|
||||
var cachedData = this.cachedData;
|
||||
while (bitsCached < n) {
|
||||
@ -2169,7 +2169,7 @@ var LZWStream = (function lZWStream() {
|
||||
return (cachedData >>> bitsCached) & ((1 << n) - 1);
|
||||
};
|
||||
|
||||
constructor.prototype.readBlock = function lZWStreamReadBlock() {
|
||||
constructor.prototype.readBlock = function lzwStreamReadBlock() {
|
||||
var blockSize = 512;
|
||||
var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize;
|
||||
var i, j, q;
|
||||
@ -3689,7 +3689,7 @@ var Catalog = (function catalogCatalog() {
|
||||
return constructor;
|
||||
})();
|
||||
|
||||
var PDFDoc = (function pDFDoc() {
|
||||
var PDFDoc = (function pdfDoc() {
|
||||
function constructor(stream) {
|
||||
assertWellFormed(stream.length > 0, 'stream must have data');
|
||||
this.stream = stream;
|
||||
@ -3768,7 +3768,7 @@ var PDFDoc = (function pDFDoc() {
|
||||
},
|
||||
// Find the header, remove leading garbage and setup the stream
|
||||
// starting from the header.
|
||||
checkHeader: function pDFDocCheckHeader() {
|
||||
checkHeader: function pdfDocCheckHeader() {
|
||||
var stream = this.stream;
|
||||
stream.reset();
|
||||
if (find(stream, '%PDF-', 1024)) {
|
||||
@ -3778,7 +3778,7 @@ var PDFDoc = (function pDFDoc() {
|
||||
}
|
||||
// May not be a PDF file, continue anyway.
|
||||
},
|
||||
setup: function pDFDocSetup(ownerPassword, userPassword) {
|
||||
setup: function pdfDocSetup(ownerPassword, userPassword) {
|
||||
this.checkHeader();
|
||||
this.xref = new XRef(this.stream,
|
||||
this.startXRef,
|
||||
@ -3791,7 +3791,7 @@ var PDFDoc = (function pDFDoc() {
|
||||
// shadow the prototype getter
|
||||
return shadow(this, 'numPages', num);
|
||||
},
|
||||
getPage: function pDFDocGetPage(n) {
|
||||
getPage: function pdfDocGetPage(n) {
|
||||
return this.catalog.getPage(n);
|
||||
}
|
||||
};
|
||||
@ -6158,7 +6158,7 @@ var TilingPattern = (function tilingPattern() {
|
||||
})();
|
||||
|
||||
|
||||
var PDFImage = (function pDFImage() {
|
||||
var PDFImage = (function pdfImage() {
|
||||
function constructor(xref, res, image, inline) {
|
||||
this.image = image;
|
||||
if (image.getParams) {
|
||||
@ -6369,7 +6369,7 @@ var PDFImage = (function pDFImage() {
|
||||
return constructor;
|
||||
})();
|
||||
|
||||
var PDFFunction = (function pDFFunction() {
|
||||
var PDFFunction = (function pdfFunction() {
|
||||
function constructor(xref, fn) {
|
||||
var dict = fn.dict;
|
||||
if (!dict)
|
||||
@ -6390,7 +6390,7 @@ var PDFFunction = (function pDFFunction() {
|
||||
}
|
||||
|
||||
constructor.prototype = {
|
||||
constructSampled: function pDFFunctionConstructSampled(str, dict) {
|
||||
constructSampled: function pdfFunctionConstructSampled(str, dict) {
|
||||
var domain = dict.get('Domain');
|
||||
var range = dict.get('Range');
|
||||
|
||||
@ -6426,8 +6426,8 @@ var PDFFunction = (function pDFFunction() {
|
||||
|
||||
var samples = this.getSampleArray(size, outputSize, bps, str);
|
||||
|
||||
this.func = function pDFFunctionFunc(args) {
|
||||
var clip = function pDFFunctionClip(v, min, max) {
|
||||
this.func = function pdfFunctionFunc(args) {
|
||||
var clip = function pdfFunctionClip(v, min, max) {
|
||||
if (v > max)
|
||||
v = max;
|
||||
else if (v < min)
|
||||
@ -6485,7 +6485,7 @@ var PDFFunction = (function pDFFunction() {
|
||||
return output;
|
||||
};
|
||||
},
|
||||
getSampleArray: function pDFFunctionGetSampleArray(size, outputSize, bps,
|
||||
getSampleArray: function pdfFunctionGetSampleArray(size, outputSize, bps,
|
||||
str) {
|
||||
var length = 1;
|
||||
for (var i = 0; i < size.length; i++)
|
||||
@ -6511,7 +6511,7 @@ var PDFFunction = (function pDFFunction() {
|
||||
}
|
||||
return array;
|
||||
},
|
||||
constructInterpolated: function pDFFunctionConstructInterpolated(str,
|
||||
constructInterpolated: function pdfFunctionConstructInterpolated(str,
|
||||
dict) {
|
||||
var c0 = dict.get('C0') || [0];
|
||||
var c1 = dict.get('C1') || [1];
|
||||
@ -6525,7 +6525,7 @@ var PDFFunction = (function pDFFunction() {
|
||||
for (var i = 0; i < length; ++i)
|
||||
diff.push(c1[i] - c0[i]);
|
||||
|
||||
this.func = function pDFFunctionConstructInterpolatedFunc(args) {
|
||||
this.func = function pdfFunctionConstructInterpolatedFunc(args) {
|
||||
var x = args[0];
|
||||
|
||||
var out = [];
|
||||
@ -6535,7 +6535,7 @@ var PDFFunction = (function pDFFunction() {
|
||||
return out;
|
||||
};
|
||||
},
|
||||
constructStiched: function pDFFunctionConstructStiched(fn, dict, xref) {
|
||||
constructStiched: function pdfFunctionConstructStiched(fn, dict, xref) {
|
||||
var domain = dict.get('Domain');
|
||||
var range = dict.get('Range');
|
||||
|
||||
@ -6554,8 +6554,8 @@ var PDFFunction = (function pDFFunction() {
|
||||
var bounds = dict.get('Bounds');
|
||||
var encode = dict.get('Encode');
|
||||
|
||||
this.func = function pDFFunctionConstructStichedFunc(args) {
|
||||
var clip = function pDFFunctionConstructStichedFuncClip(v, min, max) {
|
||||
this.func = function pdfFunctionConstructStichedFunc(args) {
|
||||
var clip = function pdfFunctionConstructStichedFuncClip(v, min, max) {
|
||||
if (v > max)
|
||||
v = max;
|
||||
else if (v < min)
|
||||
@ -6588,9 +6588,9 @@ var PDFFunction = (function pDFFunction() {
|
||||
return fns[i].func([v2]);
|
||||
};
|
||||
},
|
||||
constructPostScript: function pDFFunctionConstructPostScript() {
|
||||
constructPostScript: function pdfFunctionConstructPostScript() {
|
||||
TODO('unhandled type of function');
|
||||
this.func = function pDFFunctionConstructPostScriptFunc() {
|
||||
this.func = function pdfFunctionConstructPostScriptFunc() {
|
||||
return [255, 105, 180];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user