Merge pull request #8474 from Snuffleupagus/ESLint-object-styles-src-core

Fix inconsistent spacing and trailing commas in objects in `src/core/` files, so we can enable the `comma-dangle` and `object-curly-spacing` ESLint rules later on
This commit is contained in:
Tim van der Meij 2017-06-03 22:22:00 +02:00 committed by GitHub
commit a3fae906a6
29 changed files with 586 additions and 582 deletions

View File

@ -111,7 +111,7 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
} }
return new Annotation(parameters); return new Annotation(parameters);
} }
} },
}; };
var Annotation = (function AnnotationClosure() { var Annotation = (function AnnotationClosure() {
@ -435,7 +435,7 @@ var Annotation = (function AnnotationClosure() {
return opList; return opList;
}); });
}); });
} },
}; };
return Annotation; return Annotation;
@ -573,7 +573,7 @@ var AnnotationBorderStyle = (function AnnotationBorderStyleClosure() {
if (radius === (radius | 0)) { if (radius === (radius | 0)) {
this.verticalCornerRadius = radius; this.verticalCornerRadius = radius;
} }
} },
}; };
return AnnotationBorderStyle; return AnnotationBorderStyle;
@ -736,7 +736,7 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
}).then(function () { }).then(function () {
return operatorList; return operatorList;
}); });
} },
}); });
return TextWidgetAnnotation; return TextWidgetAnnotation;
@ -806,7 +806,7 @@ var ButtonWidgetAnnotation = (function ButtonWidgetAnnotationClosure() {
renderForms); renderForms);
} }
return Promise.resolve(operatorList); return Promise.resolve(operatorList);
} },
}); });
return ButtonWidgetAnnotation; return ButtonWidgetAnnotation;
@ -867,7 +867,7 @@ var ChoiceWidgetAnnotation = (function ChoiceWidgetAnnotationClosure() {
return Annotation.prototype.getOperatorList.call(this, evaluator, task, return Annotation.prototype.getOperatorList.call(this, evaluator, task,
renderForms); renderForms);
} },
}); });
return ChoiceWidgetAnnotation; return ChoiceWidgetAnnotation;

View File

@ -24,53 +24,53 @@
var ArithmeticDecoder = (function ArithmeticDecoderClosure() { var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
// Table C-2 // Table C-2
var QeTable = [ var QeTable = [
{qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1}, { qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1, },
{qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0}, { qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0, },
{qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0}, { qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0, },
{qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0}, { qe: 0x0AC1, nmps: 4, nlps: 12, switchFlag: 0, },
{qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0}, { qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0, },
{qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0}, { qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0, },
{qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1}, { qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1, },
{qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0}, { qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0, },
{qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0}, { qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0, },
{qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0}, { qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0, },
{qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0}, { qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0, },
{qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0}, { qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0, },
{qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0}, { qe: 0x1C01, nmps: 13, nlps: 20, switchFlag: 0, },
{qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0}, { qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0, },
{qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1}, { qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1, },
{qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0}, { qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0, },
{qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0}, { qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0, },
{qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0}, { qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0, },
{qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0}, { qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0, },
{qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0}, { qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0, },
{qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0}, { qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0, },
{qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0}, { qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0, },
{qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0}, { qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0, },
{qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0}, { qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0, },
{qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0}, { qe: 0x1C01, nmps: 25, nlps: 22, switchFlag: 0, },
{qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0}, { qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0, },
{qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0}, { qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0, },
{qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0}, { qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0, },
{qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0}, { qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0, },
{qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0}, { qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0, },
{qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0}, { qe: 0x0AC1, nmps: 31, nlps: 28, switchFlag: 0, },
{qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0}, { qe: 0x09C1, nmps: 32, nlps: 29, switchFlag: 0, },
{qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0}, { qe: 0x08A1, nmps: 33, nlps: 30, switchFlag: 0, },
{qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0}, { qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0, },
{qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0}, { qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0, },
{qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0}, { qe: 0x02A1, nmps: 36, nlps: 33, switchFlag: 0, },
{qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0}, { qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0, },
{qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0}, { qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0, },
{qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0}, { qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0, },
{qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0}, { qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0, },
{qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0}, { qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0, },
{qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0}, { qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0, },
{qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0}, { qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0, },
{qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0}, { qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0, },
{qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0}, { qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0, },
{qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0}, { qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0, },
{qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0} { qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0, }
]; ];
// C.3.5 Initialisation of the decoder (INITDEC) // C.3.5 Initialisation of the decoder (INITDEC)
@ -174,7 +174,7 @@ var ArithmeticDecoder = (function ArithmeticDecoderClosure() {
contexts[pos] = cx_index << 1 | cx_mps; contexts[pos] = cx_index << 1 | cx_mps;
return d; return d;
} },
}; };
return ArithmeticDecoder; return ArithmeticDecoder;

View File

@ -105,7 +105,7 @@ function reverseValues(arr, start, end) {
function createBidiText(str, isLTR, vertical) { function createBidiText(str, isLTR, vertical) {
return { return {
str, str,
dir: (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl')) dir: (vertical ? 'ttb' : (isLTR ? 'ltr' : 'rtl')),
}; };
} }

View File

@ -100,97 +100,97 @@ var CFFStandardStrings = [
var CFFParser = (function CFFParserClosure() { var CFFParser = (function CFFParserClosure() {
var CharstringValidationData = [ var CharstringValidationData = [
null, null,
{ id: 'hstem', min: 2, stackClearing: true, stem: true }, { id: 'hstem', min: 2, stackClearing: true, stem: true, },
null, null,
{ id: 'vstem', min: 2, stackClearing: true, stem: true }, { id: 'vstem', min: 2, stackClearing: true, stem: true, },
{ id: 'vmoveto', min: 1, stackClearing: true }, { id: 'vmoveto', min: 1, stackClearing: true, },
{ id: 'rlineto', min: 2, resetStack: true }, { id: 'rlineto', min: 2, resetStack: true, },
{ id: 'hlineto', min: 1, resetStack: true }, { id: 'hlineto', min: 1, resetStack: true, },
{ id: 'vlineto', min: 1, resetStack: true }, { id: 'vlineto', min: 1, resetStack: true, },
{ id: 'rrcurveto', min: 6, resetStack: true }, { id: 'rrcurveto', min: 6, resetStack: true, },
null, null,
{ id: 'callsubr', min: 1, undefStack: true }, { id: 'callsubr', min: 1, undefStack: true, },
{ id: 'return', min: 0, undefStack: true }, { id: 'return', min: 0, undefStack: true, },
null, // 12 null, // 12
null, null,
{ id: 'endchar', min: 0, stackClearing: true }, { id: 'endchar', min: 0, stackClearing: true, },
null, null,
null, null,
null, null,
{ id: 'hstemhm', min: 2, stackClearing: true, stem: true }, { id: 'hstemhm', min: 2, stackClearing: true, stem: true, },
{ id: 'hintmask', min: 0, stackClearing: true }, { id: 'hintmask', min: 0, stackClearing: true, },
{ id: 'cntrmask', min: 0, stackClearing: true }, { id: 'cntrmask', min: 0, stackClearing: true, },
{ id: 'rmoveto', min: 2, stackClearing: true }, { id: 'rmoveto', min: 2, stackClearing: true, },
{ id: 'hmoveto', min: 1, stackClearing: true }, { id: 'hmoveto', min: 1, stackClearing: true, },
{ id: 'vstemhm', min: 2, stackClearing: true, stem: true }, { id: 'vstemhm', min: 2, stackClearing: true, stem: true, },
{ id: 'rcurveline', min: 8, resetStack: true }, { id: 'rcurveline', min: 8, resetStack: true, },
{ id: 'rlinecurve', min: 8, resetStack: true }, { id: 'rlinecurve', min: 8, resetStack: true, },
{ id: 'vvcurveto', min: 4, resetStack: true }, { id: 'vvcurveto', min: 4, resetStack: true, },
{ id: 'hhcurveto', min: 4, resetStack: true }, { id: 'hhcurveto', min: 4, resetStack: true, },
null, // shortint null, // shortint
{ id: 'callgsubr', min: 1, undefStack: true }, { id: 'callgsubr', min: 1, undefStack: true, },
{ id: 'vhcurveto', min: 4, resetStack: true }, { id: 'vhcurveto', min: 4, resetStack: true, },
{ id: 'hvcurveto', min: 4, resetStack: true } { id: 'hvcurveto', min: 4, resetStack: true, }
]; ];
var CharstringValidationData12 = [ var CharstringValidationData12 = [
null, null,
null, null,
null, null,
{ id: 'and', min: 2, stackDelta: -1 }, { id: 'and', min: 2, stackDelta: -1, },
{ id: 'or', min: 2, stackDelta: -1 }, { id: 'or', min: 2, stackDelta: -1, },
{ id: 'not', min: 1, stackDelta: 0 }, { id: 'not', min: 1, stackDelta: 0, },
null, null,
null, null,
null, null,
{ id: 'abs', min: 1, stackDelta: 0 }, { id: 'abs', min: 1, stackDelta: 0, },
{ id: 'add', min: 2, stackDelta: -1, { id: 'add', min: 2, stackDelta: -1,
stackFn: function stack_div(stack, index) { stackFn: function stack_div(stack, index) {
stack[index - 2] = stack[index - 2] + stack[index - 1]; stack[index - 2] = stack[index - 2] + stack[index - 1];
} },
}, },
{ id: 'sub', min: 2, stackDelta: -1, { id: 'sub', min: 2, stackDelta: -1,
stackFn: function stack_div(stack, index) { stackFn: function stack_div(stack, index) {
stack[index - 2] = stack[index - 2] - stack[index - 1]; stack[index - 2] = stack[index - 2] - stack[index - 1];
} },
}, },
{ id: 'div', min: 2, stackDelta: -1, { id: 'div', min: 2, stackDelta: -1,
stackFn: function stack_div(stack, index) { stackFn: function stack_div(stack, index) {
stack[index - 2] = stack[index - 2] / stack[index - 1]; stack[index - 2] = stack[index - 2] / stack[index - 1];
} },
}, },
null, null,
{ id: 'neg', min: 1, stackDelta: 0, { id: 'neg', min: 1, stackDelta: 0,
stackFn: function stack_div(stack, index) { stackFn: function stack_div(stack, index) {
stack[index - 1] = -stack[index - 1]; stack[index - 1] = -stack[index - 1];
}
}, },
{ id: 'eq', min: 2, stackDelta: -1 }, },
{ id: 'eq', min: 2, stackDelta: -1, },
null, null,
null, null,
{ id: 'drop', min: 1, stackDelta: -1 }, { id: 'drop', min: 1, stackDelta: -1, },
null, null,
{ id: 'put', min: 2, stackDelta: -2 }, { id: 'put', min: 2, stackDelta: -2, },
{ id: 'get', min: 1, stackDelta: 0 }, { id: 'get', min: 1, stackDelta: 0, },
{ id: 'ifelse', min: 4, stackDelta: -3 }, { id: 'ifelse', min: 4, stackDelta: -3, },
{ id: 'random', min: 0, stackDelta: 1 }, { id: 'random', min: 0, stackDelta: 1, },
{ id: 'mul', min: 2, stackDelta: -1, { id: 'mul', min: 2, stackDelta: -1,
stackFn: function stack_div(stack, index) { stackFn: function stack_div(stack, index) {
stack[index - 2] = stack[index - 2] * stack[index - 1]; stack[index - 2] = stack[index - 2] * stack[index - 1];
} },
}, },
null, null,
{ id: 'sqrt', min: 1, stackDelta: 0 }, { id: 'sqrt', min: 1, stackDelta: 0, },
{ id: 'dup', min: 1, stackDelta: 1 }, { id: 'dup', min: 1, stackDelta: 1, },
{ id: 'exch', min: 2, stackDelta: 0 }, { id: 'exch', min: 2, stackDelta: 0, },
{ id: 'index', min: 2, stackDelta: 0 }, { id: 'index', min: 2, stackDelta: 0, },
{ id: 'roll', min: 3, stackDelta: -2 }, { id: 'roll', min: 3, stackDelta: -2, },
null, null,
null, null,
null, null,
{ id: 'hflex', min: 7, resetStack: true }, { id: 'hflex', min: 7, resetStack: true, },
{ id: 'flex', min: 13, resetStack: true }, { id: 'flex', min: 13, resetStack: true, },
{ id: 'hflex1', min: 9, resetStack: true }, { id: 'hflex1', min: 9, resetStack: true, },
{ id: 'flex1', min: 11, resetStack: true } { id: 'flex1', min: 11, resetStack: true, }
]; ];
function CFFParser(file, properties, seacAnalysisEnabled) { function CFFParser(file, properties, seacAnalysisEnabled) {
@ -302,7 +302,7 @@ var CFFParser = (function CFFParserClosure() {
var hdrSize = bytes[2]; var hdrSize = bytes[2];
var offSize = bytes[3]; var offSize = bytes[3];
var header = new CFFHeader(major, minor, hdrSize, offSize); var header = new CFFHeader(major, minor, hdrSize, offSize);
return { obj: header, endPos: hdrSize }; return { obj: header, endPos: hdrSize, };
}, },
parseDict: function CFFParser_parseDict(dict) { parseDict: function CFFParser_parseDict(dict) {
var pos = 0; var pos = 0;
@ -404,7 +404,7 @@ var CFFParser = (function CFFParserClosure() {
var offsetEnd = offsets[i + 1]; var offsetEnd = offsets[i + 1];
cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); cffIndex.add(bytes.subarray(offsetStart, offsetEnd));
} }
return {obj: cffIndex, endPos: end}; return { obj: cffIndex, endPos: end, };
}, },
parseNameIndex: function CFFParser_parseNameIndex(index) { parseNameIndex: function CFFParser_parseNameIndex(index) {
var names = []; var names = [];
@ -618,7 +618,7 @@ var CFFParser = (function CFFParserClosure() {
hints: 0, hints: 0,
firstStackClearing: true, firstStackClearing: true,
seac: null, seac: null,
width: null width: null,
}; };
var valid = true; var valid = true;
var localSubrToUse = null; var localSubrToUse = null;
@ -875,7 +875,7 @@ var CFFParser = (function CFFParserClosure() {
assert(fdSelect.length === length, 'parseFDSelect: Invalid font data.'); assert(fdSelect.length === length, 'parseFDSelect: Invalid font data.');
return new CFFFDSelect(fdSelect, rawBytes); return new CFFFDSelect(fdSelect, rawBytes);
} },
}; };
return CFFParser; return CFFParser;
})(); })();
@ -931,7 +931,7 @@ var CFFStrings = (function CFFStringsClosure() {
}, },
get count() { get count() {
return this.strings.length; return this.strings.length;
} },
}; };
return CFFStrings; return CFFStrings;
})(); })();
@ -955,7 +955,7 @@ var CFFIndex = (function CFFIndexClosure() {
}, },
get count() { get count() {
return this.objects.length; return this.objects.length;
} },
}; };
return CFFIndex; return CFFIndex;
})(); })();
@ -1018,7 +1018,7 @@ var CFFDict = (function CFFDictClosure() {
}, },
removeByName: function CFFDict_removeByName(name) { removeByName: function CFFDict_removeByName(name) {
delete this.values[this.nameToKeyMap[name]]; delete this.values[this.nameToKeyMap[name]];
} },
}; };
CFFDict.createTables = function CFFDict_createTables(layout) { CFFDict.createTables = function CFFDict_createTables(layout) {
var tables = { var tables = {
@ -1027,7 +1027,7 @@ var CFFDict = (function CFFDictClosure() {
defaults: {}, defaults: {},
types: {}, types: {},
opcodes: {}, opcodes: {},
order: [] order: [],
}; };
for (var i = 0, ii = layout.length; i < ii; ++i) { for (var i = 0, ii = layout.length; i < ii; ++i) {
var entry = layout[i]; var entry = layout[i];
@ -1132,7 +1132,7 @@ var CFFPrivateDict = (function CFFPrivateDictClosure() {
var CFFCharsetPredefinedTypes = { var CFFCharsetPredefinedTypes = {
ISO_ADOBE: 0, ISO_ADOBE: 0,
EXPERT: 1, EXPERT: 1,
EXPERT_SUBSET: 2 EXPERT_SUBSET: 2,
}; };
var CFFCharset = (function CFFCharsetClosure() { var CFFCharset = (function CFFCharsetClosure() {
function CFFCharset(predefined, format, charset, raw) { function CFFCharset(predefined, format, charset, raw) {
@ -1165,7 +1165,7 @@ var CFFFDSelect = (function CFFFDSelectClosure() {
return -1; return -1;
} }
return this.fdSelect[glyphIndex]; return this.fdSelect[glyphIndex];
} },
}; };
return CFFFDSelect; return CFFFDSelect;
})(); })();
@ -1218,7 +1218,7 @@ var CFFOffsetTracker = (function CFFOffsetTrackerClosure() {
data[offset3] = (value >> 8) & 0xFF; data[offset3] = (value >> 8) & 0xFF;
data[offset4] = value & 0xFF; data[offset4] = value & 0xFF;
} }
} },
}; };
return CFFOffsetTracker; return CFFOffsetTracker;
})(); })();
@ -1237,7 +1237,7 @@ var CFFCompiler = (function CFFCompilerClosure() {
add: function CFFCompiler_add(data) { add: function CFFCompiler_add(data) {
this.data = this.data.concat(data); this.data = this.data.concat(data);
this.length = this.data.length; this.length = this.data.length;
} },
}; };
// Compile the five entries that must be in order. // Compile the five entries that must be in order.
@ -1433,7 +1433,7 @@ var CFFCompiler = (function CFFCompilerClosure() {
fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers);
return { return {
trackers: fontDictTrackers, trackers: fontDictTrackers,
output: fdArrayIndex output: fdArrayIndex,
}; };
}, },
compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts, compilePrivateDicts: function CFFCompiler_compilePrivateDicts(dicts,
@ -1625,7 +1625,7 @@ var CFFCompiler = (function CFFCompilerClosure() {
} }
} }
return data; return data;
} },
}; };
return CFFCompiler; return CFFCompiler;
})(); })();

View File

@ -435,12 +435,12 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
if (prevChunk >= 0 && prevChunk + 1 !== chunk) { if (prevChunk >= 0 && prevChunk + 1 !== chunk) {
groupedChunks.push({ beginChunk, groupedChunks.push({ beginChunk,
endChunk: prevChunk + 1 }); endChunk: prevChunk + 1, });
beginChunk = chunk; beginChunk = chunk;
} }
if (i + 1 === chunks.length) { if (i + 1 === chunks.length) {
groupedChunks.push({ beginChunk, groupedChunks.push({ beginChunk,
endChunk: chunk + 1 }); endChunk: chunk + 1, });
} }
prevChunk = chunk; prevChunk = chunk;
@ -453,7 +453,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
args.loaded); args.loaded);
this.msgHandler.send('DocProgress', { this.msgHandler.send('DocProgress', {
loaded: bytesLoaded, loaded: bytesLoaded,
total: this.length total: this.length,
}); });
}, },
@ -529,7 +529,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
this.msgHandler.send('DocProgress', { this.msgHandler.send('DocProgress', {
loaded: this.stream.numChunksLoaded * this.chunkSize, loaded: this.stream.numChunksLoaded * this.chunkSize,
total: this.length total: this.length,
}); });
}, },
@ -556,7 +556,7 @@ var ChunkedStreamManager = (function ChunkedStreamManagerClosure() {
var capability = this.promisesByRequest[requestId]; var capability = this.promisesByRequest[requestId];
capability.reject(new Error('Request was aborted')); capability.reject(new Error('Request was aborted'));
} }
} },
}; };
return ChunkedStreamManager; return ChunkedStreamManager;

View File

@ -335,7 +335,7 @@ var CMap = (function CMapClosure() {
} }
} }
return true; return true;
} },
}; };
return CMap; return CMap;
})(); })();
@ -404,7 +404,7 @@ var IdentityCMap = (function IdentityCMapClosure() {
get isIdentityCMap() { get isIdentityCMap() {
error('should not access .isIdentityCMap'); error('should not access .isIdentityCMap');
} },
}; };
return IdentityCMap; return IdentityCMap;
@ -527,7 +527,7 @@ var BinaryCMapReader = (function BinaryCMapReaderClosure() {
s += String.fromCharCode(this.readNumber()); s += String.fromCharCode(this.readNumber());
} }
return s; return s;
} },
}; };
function processBinaryCMap(data, cMap, extend) { function processBinaryCMap(data, cMap, extend) {
@ -983,7 +983,7 @@ var CMapFactory = (function CMapFactoryClosure() {
}); });
} }
return Promise.reject(new Error('Encoding required.')); return Promise.reject(new Error('Encoding required.'));
} },
}; };
})(); })();

View File

@ -197,7 +197,7 @@ var ColorSpace = (function ColorSpaceClosure() {
* This should be true for all colorspaces except for lab color spaces * This should be true for all colorspaces except for lab color spaces
* which are [0,100], [-128, 127], [-128, 127]. * which are [0,100], [-128, 127], [-128, 127].
*/ */
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
ColorSpace.parse = function ColorSpace_parse(cs, xref, res) { ColorSpace.parse = function ColorSpace_parse(cs, xref, res) {
@ -408,7 +408,7 @@ var ColorSpace = (function ColorSpaceClosure() {
}, },
get cmyk() { get cmyk() {
return shadow(this, 'cmyk', new DeviceCmykCS()); return shadow(this, 'cmyk', new DeviceCmykCS());
} },
}; };
return ColorSpace; return ColorSpace;
@ -489,7 +489,7 @@ var AlternateCS = (function AlternateCSClosure() {
isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) { isDefaultDecode: function AlternateCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return AlternateCS; return AlternateCS;
@ -564,7 +564,7 @@ var IndexedCS = (function IndexedCSClosure() {
// indexed color maps shouldn't be changed // indexed color maps shouldn't be changed
return true; return true;
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return IndexedCS; return IndexedCS;
})(); })();
@ -606,7 +606,7 @@ var DeviceGrayCS = (function DeviceGrayCSClosure() {
isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) { isDefaultDecode: function DeviceGrayCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return DeviceGrayCS; return DeviceGrayCS;
})(); })();
@ -655,7 +655,7 @@ var DeviceRgbCS = (function DeviceRgbCSClosure() {
isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) { isDefaultDecode: function DeviceRgbCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return DeviceRgbCS; return DeviceRgbCS;
})(); })();
@ -737,7 +737,7 @@ var DeviceCmykCS = (function DeviceCmykCSClosure() {
isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) { isDefaultDecode: function DeviceCmykCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return DeviceCmykCS; return DeviceCmykCS;
@ -834,7 +834,7 @@ var CalGrayCS = (function CalGrayCSClosure() {
isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) { isDefaultDecode: function CalGrayCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return CalGrayCS; return CalGrayCS;
})(); })();
@ -1137,7 +1137,7 @@ var CalRGBCS = (function CalRGBCSClosure() {
isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) { isDefaultDecode: function CalRGBCS_isDefaultDecode(decodeMap) {
return ColorSpace.isDefaultDecode(decodeMap, this.numComps); return ColorSpace.isDefaultDecode(decodeMap, this.numComps);
}, },
usesZeroToOneRange: true usesZeroToOneRange: true,
}; };
return CalRGBCS; return CalRGBCS;
})(); })();
@ -1281,7 +1281,7 @@ var LabCS = (function LabCSClosure() {
// ranges that are used. // ranges that are used.
return true; return true;
}, },
usesZeroToOneRange: false usesZeroToOneRange: false,
}; };
return LabCS; return LabCS;
})(); })();

View File

@ -55,7 +55,7 @@ var ARCFourCipher = (function ARCFourCipherClosure() {
this.a = a; this.a = a;
this.b = b; this.b = b;
return output; return output;
} },
}; };
ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock; ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock;
@ -229,7 +229,7 @@ var Word64 = (function Word64Closure() {
assign: function Word64_assign(word) { assign: function Word64_assign(word) {
this.high = word.high; this.high = word.high;
this.low = word.low; this.low = word.low;
} },
}; };
return Word64; return Word64;
})(); })();
@ -623,7 +623,7 @@ var NullCipher = (function NullCipherClosure() {
NullCipher.prototype = { NullCipher.prototype = {
decryptBlock: function NullCipher_decryptBlock(data) { decryptBlock: function NullCipher_decryptBlock(data) {
return data; return data;
} },
}; };
return NullCipher; return NullCipher;
@ -1055,7 +1055,7 @@ var AES128Cipher = (function AES128CipherClosure() {
output.set(result[i], j); output.set(result[i], j);
} }
return output; return output;
} },
}; };
return AES128Cipher; return AES128Cipher;
@ -1487,7 +1487,7 @@ var AES256Cipher = (function AES256CipherClosure() {
output.set(result[i], j); output.set(result[i], j);
} }
return output; return output;
} },
}; };
return AES256Cipher; return AES256Cipher;
@ -1555,7 +1555,7 @@ var PDF17 = (function PDF17Closure() {
return cipher.decryptBlock(userEncryption, return cipher.decryptBlock(userEncryption,
false, false,
new Uint8Array(16)); new Uint8Array(16));
} },
}; };
return PDF17; return PDF17;
})(); })();
@ -1673,7 +1673,7 @@ var PDF20 = (function PDF20Closure() {
return cipher.decryptBlock(userEncryption, return cipher.decryptBlock(userEncryption,
false, false,
new Uint8Array(16)); new Uint8Array(16));
} },
}; };
return PDF20; return PDF20;
})(); })();
@ -1698,7 +1698,7 @@ var CipherTransform = (function CipherTransformClosure() {
var data = stringToBytes(s); var data = stringToBytes(s);
data = cipher.decryptBlock(data, true); data = cipher.decryptBlock(data, true);
return bytesToString(data); return bytesToString(data);
} },
}; };
return CipherTransform; return CipherTransform;
})(); })();
@ -2042,7 +2042,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
return new ARCFourCipher(key); return new ARCFourCipher(key);
}; };
return new CipherTransform(cipherConstructor, cipherConstructor); return new CipherTransform(cipherConstructor, cipherConstructor);
} },
}; };
return CipherTransformFactory; return CipherTransformFactory;

View File

@ -328,7 +328,7 @@ var Page = (function PageClosure() {
} }
} }
return shadow(this, 'annotations', annotations); return shadow(this, 'annotations', annotations);
} },
}; };
return Page; return Page;
@ -395,9 +395,9 @@ var PDFDocument = (function PDFDocumentClosure() {
Producer: isString, Producer: isString,
CreationDate: isString, CreationDate: isString,
ModDate: isString, ModDate: isString,
Trapped: isName Trapped: isName,
}); });
} },
}; };
PDFDocument.prototype = { PDFDocument.prototype = {
@ -529,7 +529,7 @@ var PDFDocument = (function PDFDocumentClosure() {
createPage: (pageIndex, dict, ref, fontCache, builtInCMapCache) => { createPage: (pageIndex, dict, ref, fontCache, builtInCMapCache) => {
return new Page(this.pdfManager, this.xref, pageIndex, dict, ref, return new Page(this.pdfManager, this.xref, pageIndex, dict, ref,
fontCache, builtInCMapCache); fontCache, builtInCMapCache);
} },
}; };
this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory); this.catalog = new Catalog(this.pdfManager, this.xref, pageFactory);
}, },
@ -543,7 +543,7 @@ var PDFDocument = (function PDFDocumentClosure() {
var docInfo = { var docInfo = {
PDFFormatVersion: this.pdfFormatVersion, PDFFormatVersion: this.pdfFormatVersion,
IsAcroFormPresent: !!this.acroForm, IsAcroFormPresent: !!this.acroForm,
IsXFAPresent: !!this.xfa IsXFAPresent: !!this.xfa,
}; };
var infoDict; var infoDict;
try { try {
@ -602,7 +602,7 @@ var PDFDocument = (function PDFDocumentClosure() {
cleanup: function PDFDocument_cleanup() { cleanup: function PDFDocument_cleanup() {
return this.catalog.cleanup(); return this.catalog.cleanup();
} },
}; };
return PDFDocument; return PDFDocument;

View File

@ -79,7 +79,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var data = message.data; var data = message.data;
return new Stream(data, 0, data.length, image.dict); return new Stream(data, 0, data.length, image.dict);
}); });
} },
}; };
/** /**
* Checks if the image can be decoded and displayed by the browser without any * Checks if the image can be decoded and displayed by the browser without any
@ -154,7 +154,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
reset: function TimeSlotManager_reset() { reset: function TimeSlotManager_reset() {
this.endTime = Date.now() + TIME_SLOT_DURATION_MS; this.endTime = Date.now() + TIME_SLOT_DURATION_MS;
this.checked = 0; this.checked = 0;
} },
}; };
// Convert PDF blend mode names to HTML5 blend mode names. // Convert PDF blend mode names to HTML5 blend mode names.
@ -298,7 +298,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
bbox, bbox,
smask, smask,
isolated: false, isolated: false,
knockout: false knockout: false,
}; };
var groupSubtype = group.get('S'); var groupSubtype = group.get('S');
@ -457,7 +457,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var smaskContent = smask.get('G'); var smaskContent = smask.get('G');
var smaskOptions = { var smaskOptions = {
subtype: smask.get('S').name, subtype: smask.get('S').name,
backdrop: smask.get('BC') backdrop: smask.get('BC'),
}; };
// The SMask might have a alpha/luminosity value transfer function -- // The SMask might have a alpha/luminosity value transfer function --
@ -502,7 +502,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
operatorList.addDependencies(tilingOpList.dependencies); operatorList.addDependencies(tilingOpList.dependencies);
operatorList.addOp(fn, getTilingPatternIR({ operatorList.addOp(fn, getTilingPatternIR({
fnArray: tilingOpList.fnArray, fnArray: tilingOpList.fnArray,
argsArray: tilingOpList.argsArray argsArray: tilingOpList.argsArray,
}, patternDict, args)); }, patternDict, args));
}); });
}, },
@ -527,7 +527,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
}).catch((reason) => { }).catch((reason) => {
// Error in the font data -- sending unsupported feature notification. // Error in the font data -- sending unsupported feature notification.
this.handler.send('UnsupportedFeature', this.handler.send('UnsupportedFeature',
{featureId: UNSUPPORTED_FEATURES.font}); { featureId: UNSUPPORTED_FEATURES.font, });
return new TranslatedFont('g_font_error', return new TranslatedFont('g_font_error',
new ErrorFont('Type3 font load error: ' + reason), translated.font); new ErrorFont('Type3 font load error: ' + reason), translated.font);
}); });
@ -720,7 +720,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
} else { } else {
fontAliases[hash] = { fontAliases[hash] = {
fontID: Font.getFontID() fontID: Font.getFontID(),
}; };
} }
@ -783,7 +783,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// TODO fontCapability.reject? // TODO fontCapability.reject?
// Error in the font data -- sending unsupported feature notification. // Error in the font data -- sending unsupported feature notification.
this.handler.send('UnsupportedFeature', this.handler.send('UnsupportedFeature',
{featureId: UNSUPPORTED_FEATURES.font}); { featureId: UNSUPPORTED_FEATURES.font, });
try { try {
// error, but it's still nice to have font type reported // error, but it's still nice to have font type reported
@ -1155,7 +1155,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
// Error(s) in the OperatorList -- sending unsupported feature // Error(s) in the OperatorList -- sending unsupported feature
// notification and allow rendering to continue. // notification and allow rendering to continue.
this.handler.send('UnsupportedFeature', this.handler.send('UnsupportedFeature',
{ featureId: UNSUPPORTED_FEATURES.unknown }); { featureId: UNSUPPORTED_FEATURES.unknown, });
warn('getOperatorList - ignoring errors during task: ' + task.name); warn('getOperatorList - ignoring errors during task: ' + task.name);
closePendingRestoreOPS(); closePendingRestoreOPS();
@ -1176,7 +1176,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
var textContent = { var textContent = {
items: [], items: [],
styles: Object.create(null) styles: Object.create(null),
}; };
var textContentItem = { var textContentItem = {
initialized: false, initialized: false,
@ -1193,7 +1193,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
fakeMultiSpaceMax: -0, fakeMultiSpaceMax: -0,
textRunBreakAllowed: false, textRunBreakAllowed: false,
transform: null, transform: null,
fontName: null fontName: null,
}; };
var SPACE_FACTOR = 0.3; var SPACE_FACTOR = 0.3;
var MULTI_SPACE_FACTOR = 1.5; var MULTI_SPACE_FACTOR = 1.5;
@ -1220,7 +1220,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
fontFamily: font.fallbackName, fontFamily: font.fallbackName,
ascent: font.ascent, ascent: font.ascent,
descent: font.descent, descent: font.descent,
vertical: font.vertical vertical: font.vertical,
}; };
} }
textContentItem.fontName = font.loadedName; textContentItem.fontName = font.loadedName;
@ -1306,7 +1306,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
width: textChunk.width, width: textChunk.width,
height: textChunk.height, height: textChunk.height,
transform: textChunk.transform, transform: textChunk.transform,
fontName: textChunk.fontName fontName: textChunk.fontName,
}; };
} }
@ -1711,7 +1711,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
properties.cidSystemInfo = { properties.cidSystemInfo = {
registry: cidSystemInfo.get('Registry'), registry: cidSystemInfo.get('Registry'),
ordering: cidSystemInfo.get('Ordering'), ordering: cidSystemInfo.get('Ordering'),
supplement: cidSystemInfo.get('Supplement') supplement: cidSystemInfo.get('Supplement'),
}; };
} }
@ -2260,7 +2260,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
baseDict, baseDict,
composite, composite,
type: type.name, type: type.name,
hash: hash ? hash.hexdigest() : '' hash: hash ? hash.hexdigest() : '',
}; };
}, },
@ -2306,7 +2306,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
defaultWidth: metrics.defaultWidth, defaultWidth: metrics.defaultWidth,
flags, flags,
firstChar: 0, firstChar: 0,
lastChar: maxCharIndex lastChar: maxCharIndex,
}; };
return this.extractDataStructures(dict, dict, properties). return this.extractDataStructures(dict, dict, properties).
then((properties) => { then((properties) => {
@ -2389,7 +2389,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
capHeight: descriptor.get('CapHeight'), capHeight: descriptor.get('CapHeight'),
flags: descriptor.get('Flags'), flags: descriptor.get('Flags'),
italicAngle: descriptor.get('ItalicAngle'), italicAngle: descriptor.get('ItalicAngle'),
coded: false coded: false,
}; };
var cMapPromise; var cMapPromise;
@ -2420,7 +2420,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
} }
return new Font(fontName.name, fontFile, properties); return new Font(fontName.name, fontFile, properties);
}); });
} },
}; };
return PartialEvaluator; return PartialEvaluator;
@ -2494,7 +2494,7 @@ var TranslatedFont = (function TranslatedFontClosure() {
translatedFont.charProcOperatorList = charProcOperatorList; translatedFont.charProcOperatorList = charProcOperatorList;
}); });
return this.type3Loaded; return this.type3Loaded;
} },
}; };
return TranslatedFont; return TranslatedFont;
})(); })();
@ -2583,7 +2583,7 @@ var OperatorList = (function OperatorListClosure() {
return { return {
fnArray: this.fnArray, fnArray: this.fnArray,
argsArray: this.argsArray, argsArray: this.argsArray,
length: this.length length: this.length,
}; };
}, },
@ -2603,12 +2603,12 @@ var OperatorList = (function OperatorListClosure() {
length, length,
}, },
pageIndex: this.pageIndex, pageIndex: this.pageIndex,
intent: this.intent intent: this.intent,
}, transfers); }, transfers);
this.dependencies = Object.create(null); this.dependencies = Object.create(null);
this.fnArray.length = 0; this.fnArray.length = 0;
this.argsArray.length = 0; this.argsArray.length = 0;
} },
}; };
return OperatorList; return OperatorList;
@ -2633,7 +2633,7 @@ var StateManager = (function StateManagerClosure() {
}, },
transform(args) { transform(args) {
this.state.ctm = Util.transform(this.state.ctm, args); this.state.ctm = Util.transform(this.state.ctm, args);
} },
}; };
return StateManager; return StateManager;
})(); })();
@ -2714,7 +2714,7 @@ var TextState = (function TextStateClosure() {
clone.textLineMatrix = this.textLineMatrix.slice(); clone.textLineMatrix = this.textLineMatrix.slice();
clone.fontMatrix = this.fontMatrix.slice(); clone.fontMatrix = this.fontMatrix.slice();
return clone; return clone;
} },
}; };
return TextState; return TextState;
})(); })();
@ -2742,100 +2742,101 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
// If variableArgs === false: exactly `numArgs` expected // If variableArgs === false: exactly `numArgs` expected
var getOPMap = getLookupTableFactory(function (t) { var getOPMap = getLookupTableFactory(function (t) {
// Graphic state // Graphic state
t['w'] = { id: OPS.setLineWidth, numArgs: 1, variableArgs: false }; t['w'] = { id: OPS.setLineWidth, numArgs: 1, variableArgs: false, };
t['J'] = { id: OPS.setLineCap, numArgs: 1, variableArgs: false }; t['J'] = { id: OPS.setLineCap, numArgs: 1, variableArgs: false, };
t['j'] = { id: OPS.setLineJoin, numArgs: 1, variableArgs: false }; t['j'] = { id: OPS.setLineJoin, numArgs: 1, variableArgs: false, };
t['M'] = { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false }; t['M'] = { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false, };
t['d'] = { id: OPS.setDash, numArgs: 2, variableArgs: false }; t['d'] = { id: OPS.setDash, numArgs: 2, variableArgs: false, };
t['ri'] = { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false }; t['ri'] = { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false, };
t['i'] = { id: OPS.setFlatness, numArgs: 1, variableArgs: false }; t['i'] = { id: OPS.setFlatness, numArgs: 1, variableArgs: false, };
t['gs'] = { id: OPS.setGState, 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.save, numArgs: 0, variableArgs: false, };
t['Q'] = { id: OPS.restore, numArgs: 0, variableArgs: false }; t['Q'] = { id: OPS.restore, numArgs: 0, variableArgs: false, };
t['cm'] = { id: OPS.transform, numArgs: 6, variableArgs: false }; t['cm'] = { id: OPS.transform, numArgs: 6, variableArgs: false, };
// Path // Path
t['m'] = { id: OPS.moveTo, numArgs: 2, variableArgs: false }; t['m'] = { id: OPS.moveTo, numArgs: 2, variableArgs: false, };
t['l'] = { id: OPS.lineTo, numArgs: 2, variableArgs: false }; t['l'] = { id: OPS.lineTo, numArgs: 2, variableArgs: false, };
t['c'] = { id: OPS.curveTo, numArgs: 6, variableArgs: false }; t['c'] = { id: OPS.curveTo, numArgs: 6, variableArgs: false, };
t['v'] = { id: OPS.curveTo2, numArgs: 4, variableArgs: false }; t['v'] = { id: OPS.curveTo2, numArgs: 4, variableArgs: false, };
t['y'] = { id: OPS.curveTo3, numArgs: 4, variableArgs: false }; t['y'] = { id: OPS.curveTo3, numArgs: 4, variableArgs: false, };
t['h'] = { id: OPS.closePath, numArgs: 0, variableArgs: false }; t['h'] = { id: OPS.closePath, numArgs: 0, variableArgs: false, };
t['re'] = { id: OPS.rectangle, numArgs: 4, variableArgs: false }; t['re'] = { id: OPS.rectangle, numArgs: 4, variableArgs: false, };
t['S'] = { id: OPS.stroke, numArgs: 0, variableArgs: false }; t['S'] = { id: OPS.stroke, numArgs: 0, variableArgs: false, };
t['s'] = { id: OPS.closeStroke, 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.fill, numArgs: 0, variableArgs: false }; t['F'] = { id: OPS.fill, numArgs: 0, variableArgs: false, };
t['f*'] = { id: OPS.eoFill, 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.fillStroke, numArgs: 0, variableArgs: false, };
t['B*'] = { id: OPS.eoFillStroke, 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.closeFillStroke, numArgs: 0, variableArgs: false, };
t['b*'] = { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false }; t['b*'] = { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false, };
t['n'] = { id: OPS.endPath, numArgs: 0, variableArgs: false }; t['n'] = { id: OPS.endPath, numArgs: 0, variableArgs: false, };
// Clipping // Clipping
t['W'] = { id: OPS.clip, numArgs: 0, variableArgs: false }; t['W'] = { id: OPS.clip, numArgs: 0, variableArgs: false, };
t['W*'] = { id: OPS.eoClip, numArgs: 0, variableArgs: false }; t['W*'] = { id: OPS.eoClip, numArgs: 0, variableArgs: false, };
// Text // Text
t['BT'] = { id: OPS.beginText, numArgs: 0, variableArgs: false }; t['BT'] = { id: OPS.beginText, numArgs: 0, variableArgs: false, };
t['ET'] = { id: OPS.endText, numArgs: 0, variableArgs: false }; t['ET'] = { id: OPS.endText, numArgs: 0, variableArgs: false, };
t['Tc'] = { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false }; t['Tc'] = { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false, };
t['Tw'] = { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false }; t['Tw'] = { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false, };
t['Tz'] = { id: OPS.setHScale, numArgs: 1, variableArgs: false }; t['Tz'] = { id: OPS.setHScale, numArgs: 1, variableArgs: false, };
t['TL'] = { id: OPS.setLeading, numArgs: 1, variableArgs: false }; t['TL'] = { id: OPS.setLeading, numArgs: 1, variableArgs: false, };
t['Tf'] = { id: OPS.setFont, numArgs: 2, variableArgs: false }; t['Tf'] = { id: OPS.setFont, numArgs: 2, variableArgs: false, };
t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false }; t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1,
t['Ts'] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false }; variableArgs: false, };
t['Td'] = { id: OPS.moveText, numArgs: 2, variableArgs: false }; t['Ts'] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false, };
t['TD'] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false }; t['Td'] = { id: OPS.moveText, numArgs: 2, variableArgs: false, };
t['Tm'] = { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false }; t['TD'] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false, };
t['T*'] = { id: OPS.nextLine, numArgs: 0, variableArgs: false }; t['Tm'] = { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false, };
t['Tj'] = { id: OPS.showText, numArgs: 1, variableArgs: false }; t['T*'] = { id: OPS.nextLine, numArgs: 0, variableArgs: false, };
t['TJ'] = { id: OPS.showSpacedText, numArgs: 1, variableArgs: false }; t['Tj'] = { id: OPS.showText, numArgs: 1, variableArgs: false, };
t['\''] = { id: OPS.nextLineShowText, 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, t['"'] = { id: OPS.nextLineSetSpacingShowText, numArgs: 3,
variableArgs: false }; variableArgs: false, };
// Type3 fonts // Type3 fonts
t['d0'] = { id: OPS.setCharWidth, numArgs: 2, variableArgs: false }; t['d0'] = { id: OPS.setCharWidth, numArgs: 2, variableArgs: false, };
t['d1'] = { id: OPS.setCharWidthAndBounds, numArgs: 6, t['d1'] = { id: OPS.setCharWidthAndBounds, numArgs: 6,
variableArgs: false }; variableArgs: false, };
// Color // Color
t['CS'] = { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false }; t['CS'] = { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false, };
t['cs'] = { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false }; t['cs'] = { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false, };
t['SC'] = { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true }; t['SC'] = { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true, };
t['SCN'] = { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true }; t['SCN'] = { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true, };
t['sc'] = { id: OPS.setFillColor, numArgs: 4, variableArgs: true }; t['sc'] = { id: OPS.setFillColor, numArgs: 4, variableArgs: true, };
t['scn'] = { id: OPS.setFillColorN, numArgs: 33, variableArgs: true }; t['scn'] = { id: OPS.setFillColorN, numArgs: 33, variableArgs: true, };
t['G'] = { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false }; t['G'] = { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false, };
t['g'] = { id: OPS.setFillGray, 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.setStrokeRGBColor, numArgs: 3, variableArgs: false, };
t['rg'] = { id: OPS.setFillRGBColor, 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.setStrokeCMYKColor, numArgs: 4, variableArgs: false, };
t['k'] = { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false }; t['k'] = { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false, };
// Shading // Shading
t['sh'] = { id: OPS.shadingFill, numArgs: 1, variableArgs: false }; t['sh'] = { id: OPS.shadingFill, numArgs: 1, variableArgs: false, };
// Images // Images
t['BI'] = { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false }; t['BI'] = { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false, };
t['ID'] = { id: OPS.beginImageData, numArgs: 0, variableArgs: false }; t['ID'] = { id: OPS.beginImageData, numArgs: 0, variableArgs: false, };
t['EI'] = { id: OPS.endInlineImage, numArgs: 1, variableArgs: false }; t['EI'] = { id: OPS.endInlineImage, numArgs: 1, variableArgs: false, };
// XObjects // XObjects
t['Do'] = { id: OPS.paintXObject, numArgs: 1, variableArgs: false }; t['Do'] = { id: OPS.paintXObject, numArgs: 1, variableArgs: false, };
t['MP'] = { id: OPS.markPoint, numArgs: 1, variableArgs: false }; t['MP'] = { id: OPS.markPoint, numArgs: 1, variableArgs: false, };
t['DP'] = { id: OPS.markPointProps, numArgs: 2, variableArgs: false }; t['DP'] = { id: OPS.markPointProps, numArgs: 2, variableArgs: false, };
t['BMC'] = { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false }; t['BMC'] = { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false, };
t['BDC'] = { id: OPS.beginMarkedContentProps, numArgs: 2, t['BDC'] = { id: OPS.beginMarkedContentProps, numArgs: 2,
variableArgs: false }; variableArgs: false, };
t['EMC'] = { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false }; t['EMC'] = { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false, };
// Compatibility // Compatibility
t['BX'] = { id: OPS.beginCompat, numArgs: 0, variableArgs: false }; t['BX'] = { id: OPS.beginCompat, numArgs: 0, variableArgs: false, };
t['EX'] = { id: OPS.endCompat, numArgs: 0, variableArgs: false }; t['EX'] = { id: OPS.endCompat, numArgs: 0, variableArgs: false, };
// (reserved partial commands for the lexer) // (reserved partial commands for the lexer)
t['BM'] = null; t['BM'] = null;
@ -2968,7 +2969,7 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
this.stateManager.transform(args); this.stateManager.transform(args);
break; break;
} }
} },
}; };
return EvaluatorPreprocessor; return EvaluatorPreprocessor;
})(); })();
@ -3062,7 +3063,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() {
map.push({ map.push({
transform, transform,
x: currentX, y: currentY, x: currentX, y: currentY,
w: img.width, h: img.height w: img.width, h: img.height,
}); });
currentX += img.width + 2 * IMAGE_PADDING; currentX += img.width + 2 * IMAGE_PADDING;
maxLineHeight = Math.max(maxLineHeight, img.height); maxLineHeight = Math.max(maxLineHeight, img.height);
@ -3101,7 +3102,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() {
fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup);
argsArray.splice(iFirstSave, count * 4, argsArray.splice(iFirstSave, count * 4,
[{ width: imgWidth, height: imgHeight, kind: ImageKind.RGBA_32BPP, [{ width: imgWidth, height: imgHeight, kind: ImageKind.RGBA_32BPP,
data: imgData }, map]); data: imgData, }, map]);
return iFirstSave + 1; return iFirstSave + 1;
}); });
@ -3194,7 +3195,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() {
var maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; var maskParams = argsArray[iFirstPIMXO + (q << 2)][0];
images.push({ data: maskParams.data, width: maskParams.width, images.push({ data: maskParams.data, width: maskParams.width,
height: maskParams.height, height: maskParams.height,
transform: transformArgs }); transform: transformArgs, });
} }
// Replace queue items. // Replace queue items.
@ -3372,7 +3373,7 @@ var QueueOptimizer = (function QueueOptimizerClosure() {
i++; i++;
} }
} }
} },
}; };
return QueueOptimizer; return QueueOptimizer;
})(); })();

View File

@ -40,7 +40,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
p = start + offset + 14; p = start + offset + 14;
ranges = []; ranges = [];
for (i = 0; i < segCount; i++, p += 2) { for (i = 0; i < segCount; i++, p += 2) {
ranges[i] = {end: getUshort(data, p)}; ranges[i] = { end: getUshort(data, p), };
} }
p += 2; p += 2;
for (i = 0; i < segCount; i++, p += 2) { for (i = 0; i < segCount; i++, p += 2) {
@ -70,7 +70,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
ranges.push({ ranges.push({
start: getLong(data, p), start: getLong(data, p),
end: getLong(data, p + 4), end: getLong(data, p + 4),
idDelta: getLong(data, p + 8) - getLong(data, p) idDelta: getLong(data, p + 8) - getLong(data, p),
}); });
p += 12; p += 12;
} }
@ -88,7 +88,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
glyphs: cff.charStrings.objects, glyphs: cff.charStrings.objects,
subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex && subrs: (cff.topDict.privateDict && cff.topDict.privateDict.subrsIndex &&
cff.topDict.privateDict.subrsIndex.objects), cff.topDict.privateDict.subrsIndex.objects),
gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects gsubrs: cff.globalSubrIndex && cff.globalSubrIndex.objects,
}; };
} }
@ -139,13 +139,13 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
function compileGlyf(code, cmds, font) { function compileGlyf(code, cmds, font) {
function moveTo(x, y) { function moveTo(x, y) {
cmds.push({cmd: 'moveTo', args: [x, y]}); cmds.push({ cmd: 'moveTo', args: [x, y], });
} }
function lineTo(x, y) { function lineTo(x, y) {
cmds.push({cmd: 'lineTo', args: [x, y]}); cmds.push({ cmd: 'lineTo', args: [x, y], });
} }
function quadraticCurveTo(xa, ya, x, y) { function quadraticCurveTo(xa, ya, x, y) {
cmds.push({cmd: 'quadraticCurveTo', args: [xa, ya, x, y]}); cmds.push({ cmd: 'quadraticCurveTo', args: [xa, ya, x, y], });
} }
var i = 0; var i = 0;
@ -191,11 +191,11 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
} }
var subglyph = font.glyphs[glyphIndex]; var subglyph = font.glyphs[glyphIndex];
if (subglyph) { if (subglyph) {
cmds.push({cmd: 'save'}); cmds.push({ cmd: 'save', });
cmds.push({cmd: 'transform', cmds.push({ cmd: 'transform',
args: [scaleX, scale01, scale10, scaleY, x, y]}); args: [scaleX, scale01, scale10, scaleY, x, y], });
compileGlyf(subglyph, cmds, font); compileGlyf(subglyph, cmds, font);
cmds.push({cmd: 'restore'}); cmds.push({ cmd: 'restore', });
} }
} while ((flags & 0x20)); } while ((flags & 0x20));
} else { } else {
@ -267,7 +267,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
var p = { var p = {
flags: 1, flags: 1,
x: (contour[0].x + contour[contour.length - 1].x) / 2, x: (contour[0].x + contour[contour.length - 1].x) / 2,
y: (contour[0].y + contour[contour.length - 1].y) / 2 y: (contour[0].y + contour[contour.length - 1].y) / 2,
}; };
contour.unshift(p); contour.unshift(p);
contour.push(p); contour.push(p);
@ -297,13 +297,13 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
var stems = 0; var stems = 0;
function moveTo(x, y) { function moveTo(x, y) {
cmds.push({cmd: 'moveTo', args: [x, y]}); cmds.push({ cmd: 'moveTo', args: [x, y], });
} }
function lineTo(x, y) { function lineTo(x, y) {
cmds.push({cmd: 'lineTo', args: [x, y]}); cmds.push({ cmd: 'lineTo', args: [x, y], });
} }
function bezierCurveTo(x1, y1, x2, y2, x, y) { function bezierCurveTo(x1, y1, x2, y2, x, y) {
cmds.push({cmd: 'bezierCurveTo', args: [x1, y1, x2, y2, x, y]}); cmds.push({ cmd: 'bezierCurveTo', args: [x1, y1, x2, y2, x, y], });
} }
function parse(code) { function parse(code) {
@ -432,12 +432,12 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
var bchar = stack.pop(); var bchar = stack.pop();
y = stack.pop(); y = stack.pop();
x = stack.pop(); x = stack.pop();
cmds.push({cmd: 'save'}); cmds.push({ cmd: 'save', });
cmds.push({cmd: 'translate', args: [x, y]}); cmds.push({ cmd: 'translate', args: [x, y], });
var cmap = lookupCmap(font.cmap, String.fromCharCode( var cmap = lookupCmap(font.cmap, String.fromCharCode(
font.glyphNameMap[StandardEncoding[achar]])); font.glyphNameMap[StandardEncoding[achar]]));
compileCharString(font.glyphs[cmap.glyphId], cmds, font); compileCharString(font.glyphs[cmap.glyphId], cmds, font);
cmds.push({cmd: 'restore'}); cmds.push({ cmd: 'restore', });
cmap = lookupCmap(font.cmap, String.fromCharCode( cmap = lookupCmap(font.cmap, String.fromCharCode(
font.glyphNameMap[StandardEncoding[bchar]])); font.glyphNameMap[StandardEncoding[bchar]]));
@ -616,13 +616,13 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
} }
var cmds = []; var cmds = [];
cmds.push({cmd: 'save'}); cmds.push({ cmd: 'save', });
cmds.push({cmd: 'transform', args: this.fontMatrix.slice()}); cmds.push({ cmd: 'transform', args: this.fontMatrix.slice(), });
cmds.push({cmd: 'scale', args: ['size', '-size']}); cmds.push({ cmd: 'scale', args: ['size', '-size'], });
this.compileGlyphImpl(code, cmds); this.compileGlyphImpl(code, cmds);
cmds.push({cmd: 'restore'}); cmds.push({ cmd: 'restore', });
return cmds; return cmds;
}, },
@ -635,7 +635,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
var cmap = lookupCmap(this.cmap, unicode); var cmap = lookupCmap(this.cmap, unicode);
return (this.compiledGlyphs[cmap.glyphId] !== undefined && return (this.compiledGlyphs[cmap.glyphId] !== undefined &&
this.compiledCharCodeToGlyphId[cmap.charCode] !== undefined); this.compiledCharCodeToGlyphId[cmap.charCode] !== undefined);
} },
}; };
function TrueTypeCompiled(glyphs, cmap, fontMatrix) { function TrueTypeCompiled(glyphs, cmap, fontMatrix) {
@ -649,7 +649,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
Util.inherit(TrueTypeCompiled, CompiledFont, { Util.inherit(TrueTypeCompiled, CompiledFont, {
compileGlyphImpl(code, cmds) { compileGlyphImpl(code, cmds) {
compileGlyf(code, cmds, this); compileGlyf(code, cmds, this);
} },
}); });
function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) { function Type2Compiled(cffInfo, cmap, fontMatrix, glyphNameMap) {
@ -671,7 +671,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
Util.inherit(Type2Compiled, CompiledFont, { Util.inherit(Type2Compiled, CompiledFont, {
compileGlyphImpl(code, cmds) { compileGlyphImpl(code, cmds) {
compileCharString(code, cmds, this); compileCharString(code, cmds, this);
} },
}); });
@ -711,7 +711,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix);
} }
return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);
} },
}; };
})(); })();

View File

@ -60,7 +60,7 @@ var FontFlags = {
Italic: 64, Italic: 64,
AllCap: 65536, AllCap: 65536,
SmallCap: 131072, SmallCap: 131072,
ForceBold: 262144 ForceBold: 262144,
}; };
var MacStandardGlyphOrdering = [ var MacStandardGlyphOrdering = [
@ -347,7 +347,7 @@ var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() {
return { return {
range: searchRange, range: searchRange,
entry: log2, entry: log2,
rangeShift: entrySize * entriesCount - searchRange rangeShift: entrySize * entriesCount - searchRange,
}; };
}; };
@ -436,7 +436,7 @@ var OpenTypeFileBuilder = (function OpenTypeFileBuilderClosure() {
throw new Error('Table ' + tag + ' already exists'); throw new Error('Table ' + tag + ' already exists');
} }
this.tables[tag] = data; this.tables[tag] = data;
} },
}; };
return OpenTypeFileBuilder; return OpenTypeFileBuilder;
@ -868,7 +868,7 @@ var Font = (function FontClosure() {
if (glyphs[charCode] >= numGlyphs) { if (glyphs[charCode] >= numGlyphs) {
continue; continue;
} }
codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] }); codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode], });
} }
codes.sort(function fontGetRangesSort(a, b) { codes.sort(function fontGetRangesSort(a, b) {
return a.fontCharCode - b.fontCharCode; return a.fontCharCode - b.fontCharCode;
@ -1047,7 +1047,7 @@ var Font = (function FontClosure() {
yMax: 0, yMax: 0,
yMin: 0, yMin: 0,
ascent: 0, ascent: 0,
descent: 0 descent: 0,
}; };
var ulUnicodeRange1 = 0; var ulUnicodeRange1 = 0;
@ -1283,7 +1283,7 @@ var Font = (function FontClosure() {
numTables: ttf.getUint16(), numTables: ttf.getUint16(),
searchRange: ttf.getUint16(), searchRange: ttf.getUint16(),
entrySelector: ttf.getUint16(), entrySelector: ttf.getUint16(),
rangeShift: ttf.getUint16() rangeShift: ttf.getUint16(),
}; };
} }
@ -1298,7 +1298,7 @@ var Font = (function FontClosure() {
platformId: -1, platformId: -1,
encodingId: -1, encodingId: -1,
mappings: [], mappings: [],
hasShortCmap: false hasShortCmap: false,
}; };
} }
var segment; var segment;
@ -1362,7 +1362,7 @@ var Font = (function FontClosure() {
platformId: -1, platformId: -1,
encodingId: -1, encodingId: -1,
mappings: [], mappings: [],
hasShortCmap: false hasShortCmap: false,
}; };
} }
@ -1383,7 +1383,7 @@ var Font = (function FontClosure() {
} }
mappings.push({ mappings.push({
charCode: j, charCode: j,
glyphId: index glyphId: index,
}); });
} }
hasShortCmap = true; hasShortCmap = true;
@ -1394,7 +1394,7 @@ var Font = (function FontClosure() {
font.getBytes(6); // skipping range fields font.getBytes(6); // skipping range fields
var segIndex, segments = []; var segIndex, segments = [];
for (segIndex = 0; segIndex < segCount; segIndex++) { for (segIndex = 0; segIndex < segCount; segIndex++) {
segments.push({ end: font.getUint16() }); segments.push({ end: font.getUint16(), });
} }
font.getUint16(); font.getUint16();
for (segIndex = 0; segIndex < segCount; segIndex++) { for (segIndex = 0; segIndex < segCount; segIndex++) {
@ -1470,7 +1470,7 @@ var Font = (function FontClosure() {
platformId: -1, platformId: -1,
encodingId: -1, encodingId: -1,
mappings: [], mappings: [],
hasShortCmap: false hasShortCmap: false,
}; };
} }
@ -1838,7 +1838,7 @@ var Font = (function FontClosure() {
language: font.getUint16(), language: font.getUint16(),
name: font.getUint16(), name: font.getUint16(),
length: font.getUint16(), length: font.getUint16(),
offset: font.getUint16() offset: font.getUint16(),
}; };
// using only Macintosh and Windows platform/encoding names // using only Macintosh and Windows platform/encoding names
if ((r.platform === 1 && r.encoding === 0 && r.language === 0) || if ((r.platform === 1 && r.encoding === 0 && r.language === 0) ||
@ -2091,7 +2091,7 @@ var Font = (function FontClosure() {
functionsUsed: [], functionsUsed: [],
functionsStackDeltas: [], functionsStackDeltas: [],
tooComplexToFollowFunctions: false, tooComplexToFollowFunctions: false,
hintsValid: true hintsValid: true,
}; };
if (fpgm) { if (fpgm) {
sanitizeTTProgram(fpgm, ttContext); sanitizeTTProgram(fpgm, ttContext);
@ -2254,7 +2254,7 @@ var Font = (function FontClosure() {
yMax: int16(tables['head'].data[42], tables['head'].data[43]), yMax: int16(tables['head'].data[42], tables['head'].data[43]),
yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]), yMin: signedInt16(tables['head'].data[38], tables['head'].data[39]),
ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]), ascent: int16(tables['hhea'].data[4], tables['hhea'].data[5]),
descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]) descent: signedInt16(tables['hhea'].data[6], tables['hhea'].data[7]),
}; };
// PDF FontDescriptor metrics lie -- using data from actual font. // PDF FontDescriptor metrics lie -- using data from actual font.
@ -2435,14 +2435,14 @@ var Font = (function FontClosure() {
this.toFontChar = newMapping.toFontChar; this.toFontChar = newMapping.toFontChar;
tables['cmap'] = { tables['cmap'] = {
tag: 'cmap', tag: 'cmap',
data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs) data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs),
}; };
if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) { if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) {
tables['OS/2'] = { tables['OS/2'] = {
tag: 'OS/2', tag: 'OS/2',
data: createOS2Table(properties, newMapping.charCodeToGlyphId, data: createOS2Table(properties, newMapping.charCodeToGlyphId,
metricsOverride) metricsOverride),
}; };
} }
@ -2450,7 +2450,7 @@ var Font = (function FontClosure() {
if (!tables['post']) { if (!tables['post']) {
tables['post'] = { tables['post'] = {
tag: 'post', tag: 'post',
data: createPostTable(properties) data: createPostTable(properties),
}; };
} }
@ -2472,7 +2472,7 @@ var Font = (function FontClosure() {
if (!tables['name']) { if (!tables['name']) {
tables['name'] = { tables['name'] = {
tag: 'name', tag: 'name',
data: createNameTable(this.name) data: createNameTable(this.name),
}; };
} else { } else {
// ... using existing 'name' table as prototype // ... using existing 'name' table as prototype
@ -2543,7 +2543,7 @@ var Font = (function FontClosure() {
} }
var accentOffset = { var accentOffset = {
x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4],
y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5],
}; };
var charCodes = getCharCodes(mapping, glyphId); var charCodes = getCharCodes(mapping, glyphId);
@ -2736,7 +2736,7 @@ var Font = (function FontClosure() {
fontCharCode = seac.baseFontCharCode; fontCharCode = seac.baseFontCharCode;
accent = { accent = {
fontChar: String.fromCharCode(seac.accentFontCharCode), fontChar: String.fromCharCode(seac.accentFontCharCode),
offset: seac.accentOffset offset: seac.accentOffset,
}; };
} }
@ -2798,7 +2798,7 @@ var Font = (function FontClosure() {
// Enter the translated string into the cache // Enter the translated string into the cache
return (charsCache[charsCacheKey] = glyphs); return (charsCache[charsCacheKey] = glyphs);
} },
}; };
return Font; return Font;
@ -2816,8 +2816,8 @@ var ErrorFont = (function ErrorFontClosure() {
return []; return [];
}, },
exportData: function ErrorFont_exportData() { exportData: function ErrorFont_exportData() {
return {error: this.error}; return { error: this.error, };
} },
}; };
return ErrorFont; return ErrorFont;
@ -3246,7 +3246,7 @@ var Type1Font = (function Type1FontClosure() {
var compiler = new CFFCompiler(cff); var compiler = new CFFCompiler(cff);
return compiler.compile(); return compiler.compile();
} },
}; };
return Type1Font; return Type1Font;
@ -3307,7 +3307,7 @@ var CFFFont = (function CFFFontClosure() {
var encoding = cff.encoding ? cff.encoding.encoding : null; var encoding = cff.encoding ? cff.encoding.encoding : null;
charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets);
return charCodeToGlyphId; return charCodeToGlyphId;
} },
}; };
return CFFFont; return CFFFont;

View File

@ -460,7 +460,7 @@ var PDFFunction = (function PDFFunctionClosure() {
} }
dest.set(output, destOffset); dest.set(output, destOffset);
}; };
} },
}; };
})(); })();
@ -524,7 +524,7 @@ var PostScriptStack = (function PostScriptStackClosure() {
for (i = c, j = r; i < j; i++, j--) { for (i = c, j = r; i < j; i++, j--) {
t = stack[i]; stack[i] = stack[j]; stack[j] = t; t = stack[i]; stack[i] = stack[j]; stack[j] = t;
} }
} },
}; };
return PostScriptStack; return PostScriptStack;
})(); })();
@ -760,7 +760,7 @@ var PostScriptEvaluator = (function PostScriptEvaluatorClosure() {
} }
} }
return stack.stack; return stack.stack;
} },
}; };
return PostScriptEvaluator; return PostScriptEvaluator;
})(); })();
@ -881,7 +881,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
}, },
toString() { toString() {
return this.parts.join(''); return this.parts.join('');
} },
}; };
function buildAddOperation(num1, num2) { function buildAddOperation(num1, num2) {
@ -1126,7 +1126,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
result.push(out.join('')); result.push(out.join(''));
}); });
return result.join('\n'); return result.join('\n');
} },
}; };
return PostScriptCompiler; return PostScriptCompiler;

View File

@ -476,7 +476,7 @@ var PDFImage = (function PDFImageClosure() {
var drawHeight = this.drawHeight; var drawHeight = this.drawHeight;
var imgData = { // other fields are filled in below var imgData = { // other fields are filled in below
width: drawWidth, width: drawWidth,
height: drawHeight height: drawHeight,
}; };
var numComps = this.numComps; var numComps = this.numComps;
@ -633,7 +633,7 @@ var PDFImage = (function PDFImageClosure() {
this.image.drawHeight = drawHeight || this.height; this.image.drawHeight = drawHeight || this.height;
this.image.forceRGB = !!forceRGB; this.image.forceRGB = !!forceRGB;
return this.image.getBytes(length); return this.image.getBytes(length);
} },
}; };
return PDFImage; return PDFImage;
})(); })();

View File

@ -28,7 +28,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
return this[id]; return this[id];
} }
return (this[id] = new Int8Array(1 << 16)); return (this[id] = new Int8Array(1 << 16));
} },
}; };
function DecodingContext(data, start, end) { function DecodingContext(data, start, end) {
@ -45,7 +45,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
get contextCache() { get contextCache() {
var cache = new ContextCache(); var cache = new ContextCache();
return shadow(this, 'contextCache', cache); return shadow(this, 'contextCache', cache);
} },
}; };
// Annex A. Arithmetic Integer Decoding Procedure // Annex A. Arithmetic Integer Decoding Procedure
@ -113,29 +113,32 @@ var Jbig2Image = (function Jbig2ImageClosure() {
]; ];
var CodingTemplates = [ var CodingTemplates = [
[{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, [{ x: -1, y: -2, }, { x: 0, y: -2, }, { x: 1, y: -2, }, { x: -2, y: -1, },
{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: 2, y: -1}, { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: 2, y: -1, },
{x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, }, { x: -1, y: 0, }],
[{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: 2, y: -2}, [{ x: -1, y: -2, }, { x: 0, y: -2, }, { x: 1, y: -2, }, { x: 2, y: -2, },
{x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, { x: -2, y: -1, }, { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, },
{x: 2, y: -1}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}], { x: 2, y: -1, }, { x: -3, y: 0, }, { x: -2, y: 0, }, { x: -1, y: 0, }],
[{x: -1, y: -2}, {x: 0, y: -2}, {x: 1, y: -2}, {x: -2, y: -1}, [{ x: -1, y: -2, }, { x: 0, y: -2, }, { x: 1, y: -2, }, { x: -2, y: -1, },
{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -2, y: 0}, { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: -2, y: 0, },
{x: -1, y: 0}], { x: -1, y: 0, }],
[{x: -3, y: -1}, {x: -2, y: -1}, {x: -1, y: -1}, {x: 0, y: -1}, [{ x: -3, y: -1, }, { x: -2, y: -1, }, { x: -1, y: -1, }, { x: 0, y: -1, },
{x: 1, y: -1}, {x: -4, y: 0}, {x: -3, y: 0}, {x: -2, y: 0}, {x: -1, y: 0}] { x: 1, y: -1, }, { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, },
{ x: -1, y: 0, }]
]; ];
var RefinementTemplates = [ var RefinementTemplates = [
{ {
coding: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], coding: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }],
reference: [{x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, reference: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, },
{x: 1, y: 0}, {x: -1, y: 1}, {x: 0, y: 1}, {x: 1, y: 1}] { x: 0, y: 0, }, { x: 1, y: 0, }, { x: -1, y: 1, },
{ x: 0, y: 1, }, { x: 1, y: 1, }],
}, },
{ {
coding: [{x: -1, y: -1}, {x: 0, y: -1}, {x: 1, y: -1}, {x: -1, y: 0}], coding: [{ x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, },
reference: [{x: 0, y: -1}, {x: -1, y: 0}, {x: 0, y: 0}, {x: 1, y: 0}, { x: -1, y: 0, }],
{x: 0, y: 1}, {x: 1, y: 1}] reference: [{ x: 0, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, },
{ x: 1, y: 0, }, { x: 0, y: 1, }, { x: 1, y: 1, }],
} }
]; ];
@ -731,7 +734,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
height: readUint32(data, start + 4), height: readUint32(data, start + 4),
x: readUint32(data, start + 8), x: readUint32(data, start + 8),
y: readUint32(data, start + 12), y: readUint32(data, start + 12),
combinationOperator: data[start + 16] & 7 combinationOperator: data[start + 16] & 7,
}; };
} }
var RegionSegmentInformationFieldLength = 17; var RegionSegmentInformationFieldLength = 17;
@ -763,7 +766,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
for (i = 0; i < atLength; i++) { for (i = 0; i < atLength; i++) {
at.push({ at.push({
x: readInt8(data, position), x: readInt8(data, position),
y: readInt8(data, position + 1) y: readInt8(data, position + 1),
}); });
position += 2; position += 2;
}