mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #11818 from Snuffleupagus/eslint-dot-notation
Enable the `dot-notation` ESLint rule
This commit is contained in:
commit
7b23476e61
26 changed files with 7773 additions and 7785 deletions
|
@ -473,17 +473,17 @@ const CCITTFaxDecoder = (function CCITTFaxDecoder() {
|
|||
this.source = source;
|
||||
this.eof = false;
|
||||
|
||||
this.encoding = options["K"] || 0;
|
||||
this.eoline = options["EndOfLine"] || false;
|
||||
this.byteAlign = options["EncodedByteAlign"] || false;
|
||||
this.columns = options["Columns"] || 1728;
|
||||
this.rows = options["Rows"] || 0;
|
||||
let eoblock = options["EndOfBlock"];
|
||||
this.encoding = options.K || 0;
|
||||
this.eoline = options.EndOfLine || false;
|
||||
this.byteAlign = options.EncodedByteAlign || false;
|
||||
this.columns = options.Columns || 1728;
|
||||
this.rows = options.Rows || 0;
|
||||
let eoblock = options.EndOfBlock;
|
||||
if (eoblock === null || eoblock === undefined) {
|
||||
eoblock = true;
|
||||
}
|
||||
this.eoblock = eoblock;
|
||||
this.black = options["BlackIs1"] || false;
|
||||
this.black = options.BlackIs1 || false;
|
||||
|
||||
this.codingLine = new Uint32Array(this.columns + 1);
|
||||
this.refLine = new Uint32Array(this.columns + 2);
|
||||
|
|
|
@ -725,10 +725,10 @@ class PDFDocument {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!docInfo["Custom"]) {
|
||||
docInfo["Custom"] = Object.create(null);
|
||||
if (!docInfo.Custom) {
|
||||
docInfo.Custom = Object.create(null);
|
||||
}
|
||||
docInfo["Custom"][key] = customValue;
|
||||
docInfo.Custom[key] = customValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3533,57 +3533,57 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
|
|||
// If variableArgs === false: exactly `numArgs` expected
|
||||
var getOPMap = getLookupTableFactory(function (t) {
|
||||
// Graphic state
|
||||
t["w"] = { id: OPS.setLineWidth, numArgs: 1, variableArgs: false };
|
||||
t["J"] = { id: OPS.setLineCap, numArgs: 1, variableArgs: false };
|
||||
t["j"] = { id: OPS.setLineJoin, numArgs: 1, variableArgs: false };
|
||||
t["M"] = { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false };
|
||||
t["d"] = { id: OPS.setDash, numArgs: 2, variableArgs: false };
|
||||
t["ri"] = { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false };
|
||||
t["i"] = { id: OPS.setFlatness, numArgs: 1, variableArgs: false };
|
||||
t["gs"] = { id: OPS.setGState, numArgs: 1, variableArgs: false };
|
||||
t["q"] = { id: OPS.save, numArgs: 0, variableArgs: false };
|
||||
t["Q"] = { id: OPS.restore, numArgs: 0, variableArgs: false };
|
||||
t["cm"] = { id: OPS.transform, numArgs: 6, variableArgs: false };
|
||||
t.w = { id: OPS.setLineWidth, numArgs: 1, variableArgs: false };
|
||||
t.J = { id: OPS.setLineCap, numArgs: 1, variableArgs: false };
|
||||
t.j = { id: OPS.setLineJoin, numArgs: 1, variableArgs: false };
|
||||
t.M = { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false };
|
||||
t.d = { id: OPS.setDash, numArgs: 2, variableArgs: false };
|
||||
t.ri = { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false };
|
||||
t.i = { id: OPS.setFlatness, numArgs: 1, variableArgs: false };
|
||||
t.gs = { id: OPS.setGState, numArgs: 1, variableArgs: false };
|
||||
t.q = { id: OPS.save, numArgs: 0, variableArgs: false };
|
||||
t.Q = { id: OPS.restore, numArgs: 0, variableArgs: false };
|
||||
t.cm = { id: OPS.transform, numArgs: 6, variableArgs: false };
|
||||
|
||||
// Path
|
||||
t["m"] = { id: OPS.moveTo, numArgs: 2, variableArgs: false };
|
||||
t["l"] = { id: OPS.lineTo, numArgs: 2, variableArgs: false };
|
||||
t["c"] = { id: OPS.curveTo, numArgs: 6, variableArgs: false };
|
||||
t["v"] = { id: OPS.curveTo2, numArgs: 4, variableArgs: false };
|
||||
t["y"] = { id: OPS.curveTo3, numArgs: 4, variableArgs: false };
|
||||
t["h"] = { id: OPS.closePath, numArgs: 0, variableArgs: false };
|
||||
t["re"] = { id: OPS.rectangle, numArgs: 4, variableArgs: false };
|
||||
t["S"] = { id: OPS.stroke, numArgs: 0, variableArgs: false };
|
||||
t["s"] = { id: OPS.closeStroke, numArgs: 0, variableArgs: false };
|
||||
t["f"] = { id: OPS.fill, numArgs: 0, variableArgs: false };
|
||||
t["F"] = { id: OPS.fill, numArgs: 0, variableArgs: false };
|
||||
t.m = { id: OPS.moveTo, numArgs: 2, variableArgs: false };
|
||||
t.l = { id: OPS.lineTo, numArgs: 2, variableArgs: false };
|
||||
t.c = { id: OPS.curveTo, numArgs: 6, variableArgs: false };
|
||||
t.v = { id: OPS.curveTo2, numArgs: 4, variableArgs: false };
|
||||
t.y = { id: OPS.curveTo3, numArgs: 4, variableArgs: false };
|
||||
t.h = { id: OPS.closePath, numArgs: 0, variableArgs: false };
|
||||
t.re = { id: OPS.rectangle, numArgs: 4, variableArgs: false };
|
||||
t.S = { id: OPS.stroke, numArgs: 0, variableArgs: false };
|
||||
t.s = { id: OPS.closeStroke, numArgs: 0, variableArgs: false };
|
||||
t.f = { id: OPS.fill, numArgs: 0, variableArgs: false };
|
||||
t.F = { id: OPS.fill, numArgs: 0, variableArgs: false };
|
||||
t["f*"] = { id: OPS.eoFill, numArgs: 0, variableArgs: false };
|
||||
t["B"] = { id: OPS.fillStroke, numArgs: 0, variableArgs: false };
|
||||
t.B = { id: OPS.fillStroke, numArgs: 0, variableArgs: false };
|
||||
t["B*"] = { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false };
|
||||
t["b"] = { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false };
|
||||
t.b = { id: OPS.closeFillStroke, 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
|
||||
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 };
|
||||
|
||||
// Text
|
||||
t["BT"] = { id: OPS.beginText, numArgs: 0, variableArgs: false };
|
||||
t["ET"] = { id: OPS.endText, numArgs: 0, variableArgs: false };
|
||||
t["Tc"] = { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false };
|
||||
t["Tw"] = { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false };
|
||||
t["Tz"] = { id: OPS.setHScale, numArgs: 1, variableArgs: false };
|
||||
t["TL"] = { id: OPS.setLeading, numArgs: 1, variableArgs: false };
|
||||
t["Tf"] = { id: OPS.setFont, numArgs: 2, variableArgs: false };
|
||||
t["Tr"] = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false };
|
||||
t["Ts"] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false };
|
||||
t["Td"] = { id: OPS.moveText, numArgs: 2, variableArgs: false };
|
||||
t["TD"] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false };
|
||||
t["Tm"] = { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false };
|
||||
t.BT = { id: OPS.beginText, numArgs: 0, variableArgs: false };
|
||||
t.ET = { id: OPS.endText, numArgs: 0, variableArgs: false };
|
||||
t.Tc = { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false };
|
||||
t.Tw = { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false };
|
||||
t.Tz = { id: OPS.setHScale, numArgs: 1, variableArgs: false };
|
||||
t.TL = { id: OPS.setLeading, numArgs: 1, variableArgs: false };
|
||||
t.Tf = { id: OPS.setFont, numArgs: 2, variableArgs: false };
|
||||
t.Tr = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false };
|
||||
t.Ts = { id: OPS.setTextRise, numArgs: 1, variableArgs: false };
|
||||
t.Td = { id: OPS.moveText, numArgs: 2, variableArgs: false };
|
||||
t.TD = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false };
|
||||
t.Tm = { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false };
|
||||
t["T*"] = { id: OPS.nextLine, numArgs: 0, variableArgs: false };
|
||||
t["Tj"] = { id: OPS.showText, numArgs: 1, variableArgs: false };
|
||||
t["TJ"] = { id: OPS.showSpacedText, numArgs: 1, variableArgs: false };
|
||||
t.Tj = { id: OPS.showText, numArgs: 1, variableArgs: false };
|
||||
t.TJ = { id: OPS.showSpacedText, numArgs: 1, variableArgs: false };
|
||||
t["'"] = { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false };
|
||||
t['"'] = {
|
||||
id: OPS.nextLineSetSpacingShowText,
|
||||
|
@ -3592,62 +3592,62 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
|
|||
};
|
||||
|
||||
// Type3 fonts
|
||||
t["d0"] = { id: OPS.setCharWidth, numArgs: 2, variableArgs: false };
|
||||
t["d1"] = {
|
||||
t.d0 = { id: OPS.setCharWidth, numArgs: 2, variableArgs: false };
|
||||
t.d1 = {
|
||||
id: OPS.setCharWidthAndBounds,
|
||||
numArgs: 6,
|
||||
variableArgs: false,
|
||||
};
|
||||
|
||||
// Color
|
||||
t["CS"] = { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false };
|
||||
t["cs"] = { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false };
|
||||
t["SC"] = { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true };
|
||||
t["SCN"] = { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true };
|
||||
t["sc"] = { id: OPS.setFillColor, numArgs: 4, variableArgs: true };
|
||||
t["scn"] = { id: OPS.setFillColorN, numArgs: 33, variableArgs: true };
|
||||
t["G"] = { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false };
|
||||
t["g"] = { id: OPS.setFillGray, numArgs: 1, variableArgs: false };
|
||||
t["RG"] = { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false };
|
||||
t["rg"] = { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false };
|
||||
t["K"] = { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false };
|
||||
t["k"] = { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false };
|
||||
t.CS = { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false };
|
||||
t.cs = { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false };
|
||||
t.SC = { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true };
|
||||
t.SCN = { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true };
|
||||
t.sc = { id: OPS.setFillColor, numArgs: 4, variableArgs: true };
|
||||
t.scn = { id: OPS.setFillColorN, numArgs: 33, variableArgs: true };
|
||||
t.G = { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false };
|
||||
t.g = { id: OPS.setFillGray, numArgs: 1, variableArgs: false };
|
||||
t.RG = { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false };
|
||||
t.rg = { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false };
|
||||
t.K = { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false };
|
||||
t.k = { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false };
|
||||
|
||||
// Shading
|
||||
t["sh"] = { id: OPS.shadingFill, numArgs: 1, variableArgs: false };
|
||||
t.sh = { id: OPS.shadingFill, numArgs: 1, variableArgs: false };
|
||||
|
||||
// Images
|
||||
t["BI"] = { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false };
|
||||
t["ID"] = { id: OPS.beginImageData, numArgs: 0, variableArgs: false };
|
||||
t["EI"] = { id: OPS.endInlineImage, numArgs: 1, variableArgs: false };
|
||||
t.BI = { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false };
|
||||
t.ID = { id: OPS.beginImageData, numArgs: 0, variableArgs: false };
|
||||
t.EI = { id: OPS.endInlineImage, numArgs: 1, variableArgs: false };
|
||||
|
||||
// XObjects
|
||||
t["Do"] = { id: OPS.paintXObject, numArgs: 1, variableArgs: false };
|
||||
t["MP"] = { id: OPS.markPoint, numArgs: 1, variableArgs: false };
|
||||
t["DP"] = { id: OPS.markPointProps, numArgs: 2, variableArgs: false };
|
||||
t["BMC"] = { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false };
|
||||
t["BDC"] = {
|
||||
t.Do = { id: OPS.paintXObject, numArgs: 1, variableArgs: false };
|
||||
t.MP = { id: OPS.markPoint, numArgs: 1, variableArgs: false };
|
||||
t.DP = { id: OPS.markPointProps, numArgs: 2, variableArgs: false };
|
||||
t.BMC = { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false };
|
||||
t.BDC = {
|
||||
id: OPS.beginMarkedContentProps,
|
||||
numArgs: 2,
|
||||
variableArgs: false,
|
||||
};
|
||||
t["EMC"] = { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false };
|
||||
t.EMC = { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false };
|
||||
|
||||
// Compatibility
|
||||
t["BX"] = { id: OPS.beginCompat, numArgs: 0, variableArgs: false };
|
||||
t["EX"] = { id: OPS.endCompat, numArgs: 0, variableArgs: false };
|
||||
t.BX = { id: OPS.beginCompat, numArgs: 0, variableArgs: false };
|
||||
t.EX = { id: OPS.endCompat, numArgs: 0, variableArgs: false };
|
||||
|
||||
// (reserved partial commands for the lexer)
|
||||
t["BM"] = null;
|
||||
t["BD"] = null;
|
||||
t["true"] = null;
|
||||
t["fa"] = null;
|
||||
t["fal"] = null;
|
||||
t["fals"] = null;
|
||||
t["false"] = null;
|
||||
t["nu"] = null;
|
||||
t["nul"] = null;
|
||||
t["null"] = null;
|
||||
t.BM = null;
|
||||
t.BD = null;
|
||||
t.true = null;
|
||||
t.fa = null;
|
||||
t.fal = null;
|
||||
t.fals = null;
|
||||
t.false = null;
|
||||
t.nu = null;
|
||||
t.nul = null;
|
||||
t.null = null;
|
||||
});
|
||||
|
||||
const MAX_INVALID_PATH_OPS = 20;
|
||||
|
|
|
@ -1447,13 +1447,13 @@ var Font = (function FontClosure() {
|
|||
function readTables(file, numTables) {
|
||||
const tables = Object.create(null);
|
||||
tables["OS/2"] = null;
|
||||
tables["cmap"] = null;
|
||||
tables["head"] = null;
|
||||
tables["hhea"] = null;
|
||||
tables["hmtx"] = null;
|
||||
tables["maxp"] = null;
|
||||
tables["name"] = null;
|
||||
tables["post"] = null;
|
||||
tables.cmap = null;
|
||||
tables.head = null;
|
||||
tables.hhea = null;
|
||||
tables.hmtx = null;
|
||||
tables.maxp = null;
|
||||
tables.name = null;
|
||||
tables.post = null;
|
||||
|
||||
for (let i = 0; i < numTables; i++) {
|
||||
const table = readTableEntry(file);
|
||||
|
@ -1548,12 +1548,12 @@ var Font = (function FontClosure() {
|
|||
const potentialHeader = readOpenTypeHeader(ttc);
|
||||
const potentialTables = readTables(ttc, potentialHeader.numTables);
|
||||
|
||||
if (!potentialTables["name"]) {
|
||||
if (!potentialTables.name) {
|
||||
throw new FormatError(
|
||||
'TrueType Collection font must contain a "name" table.'
|
||||
);
|
||||
}
|
||||
const nameTable = readNameTable(potentialTables["name"]);
|
||||
const nameTable = readNameTable(potentialTables.name);
|
||||
|
||||
for (let j = 0, jj = nameTable.length; j < jj; j++) {
|
||||
for (let k = 0, kk = nameTable[j].length; k < kk; k++) {
|
||||
|
@ -2591,10 +2591,10 @@ var Font = (function FontClosure() {
|
|||
// OpenType font (skip composite fonts with non-default glyph mapping).
|
||||
if (
|
||||
(header.version === "OTTO" && !isComposite) ||
|
||||
!tables["head"] ||
|
||||
!tables["hhea"] ||
|
||||
!tables["maxp"] ||
|
||||
!tables["post"]
|
||||
!tables.head ||
|
||||
!tables.hhea ||
|
||||
!tables.maxp ||
|
||||
!tables.post
|
||||
) {
|
||||
// No major tables: throwing everything at `CFFFont`.
|
||||
cffFile = new Stream(tables["CFF "].data);
|
||||
|
@ -2605,20 +2605,20 @@ var Font = (function FontClosure() {
|
|||
return this.convert(name, cff, properties);
|
||||
}
|
||||
|
||||
delete tables["glyf"];
|
||||
delete tables["loca"];
|
||||
delete tables["fpgm"];
|
||||
delete tables["prep"];
|
||||
delete tables.glyf;
|
||||
delete tables.loca;
|
||||
delete tables.fpgm;
|
||||
delete tables.prep;
|
||||
delete tables["cvt "];
|
||||
this.isOpenType = true;
|
||||
} else {
|
||||
if (!tables["loca"]) {
|
||||
if (!tables.loca) {
|
||||
throw new FormatError('Required "loca" table is not found');
|
||||
}
|
||||
if (!tables["glyf"]) {
|
||||
if (!tables.glyf) {
|
||||
warn('Required "glyf" table is not found -- trying to recover.');
|
||||
// Note: We use `sanitizeGlyphLocations` to add dummy glyf data below.
|
||||
tables["glyf"] = {
|
||||
tables.glyf = {
|
||||
tag: "glyf",
|
||||
data: new Uint8Array(0),
|
||||
};
|
||||
|
@ -2626,11 +2626,11 @@ var Font = (function FontClosure() {
|
|||
this.isOpenType = false;
|
||||
}
|
||||
|
||||
if (!tables["maxp"]) {
|
||||
if (!tables.maxp) {
|
||||
throw new FormatError('Required "maxp" table is not found');
|
||||
}
|
||||
|
||||
font.pos = (font.start || 0) + tables["maxp"].offset;
|
||||
font.pos = (font.start || 0) + tables.maxp.offset;
|
||||
var version = font.getInt32();
|
||||
const numGlyphs = font.getUint16();
|
||||
// Glyph 0 is duplicated and appended.
|
||||
|
@ -2643,14 +2643,14 @@ var Font = (function FontClosure() {
|
|||
}
|
||||
var maxFunctionDefs = 0;
|
||||
var maxSizeOfInstructions = 0;
|
||||
if (version >= 0x00010000 && tables["maxp"].length >= 22) {
|
||||
if (version >= 0x00010000 && tables.maxp.length >= 22) {
|
||||
// maxZones can be invalid
|
||||
font.pos += 8;
|
||||
var maxZones = font.getUint16();
|
||||
if (maxZones > 2) {
|
||||
// reset to 2 if font has invalid maxZones
|
||||
tables["maxp"].data[14] = 0;
|
||||
tables["maxp"].data[15] = 2;
|
||||
tables.maxp.data[14] = 0;
|
||||
tables.maxp.data[15] = 2;
|
||||
}
|
||||
font.pos += 4;
|
||||
maxFunctionDefs = font.getUint16();
|
||||
|
@ -2658,18 +2658,18 @@ var Font = (function FontClosure() {
|
|||
maxSizeOfInstructions = font.getUint16();
|
||||
}
|
||||
|
||||
tables["maxp"].data[4] = numGlyphsOut >> 8;
|
||||
tables["maxp"].data[5] = numGlyphsOut & 255;
|
||||
tables.maxp.data[4] = numGlyphsOut >> 8;
|
||||
tables.maxp.data[5] = numGlyphsOut & 255;
|
||||
|
||||
var hintsValid = sanitizeTTPrograms(
|
||||
tables["fpgm"],
|
||||
tables["prep"],
|
||||
tables.fpgm,
|
||||
tables.prep,
|
||||
tables["cvt "],
|
||||
maxFunctionDefs
|
||||
);
|
||||
if (!hintsValid) {
|
||||
delete tables["fpgm"];
|
||||
delete tables["prep"];
|
||||
delete tables.fpgm;
|
||||
delete tables.prep;
|
||||
delete tables["cvt "];
|
||||
}
|
||||
|
||||
|
@ -2677,31 +2677,27 @@ var Font = (function FontClosure() {
|
|||
// sidebearings information for numGlyphs in the maxp table
|
||||
sanitizeMetrics(
|
||||
font,
|
||||
tables["hhea"],
|
||||
tables["hmtx"],
|
||||
tables.hhea,
|
||||
tables.hmtx,
|
||||
numGlyphsOut,
|
||||
dupFirstEntry
|
||||
);
|
||||
|
||||
if (!tables["head"]) {
|
||||
if (!tables.head) {
|
||||
throw new FormatError('Required "head" table is not found');
|
||||
}
|
||||
|
||||
sanitizeHead(
|
||||
tables["head"],
|
||||
numGlyphs,
|
||||
isTrueType ? tables["loca"].length : 0
|
||||
);
|
||||
sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0);
|
||||
|
||||
var missingGlyphs = Object.create(null);
|
||||
if (isTrueType) {
|
||||
var isGlyphLocationsLong = int16(
|
||||
tables["head"].data[50],
|
||||
tables["head"].data[51]
|
||||
tables.head.data[50],
|
||||
tables.head.data[51]
|
||||
);
|
||||
var glyphsInfo = sanitizeGlyphLocations(
|
||||
tables["loca"],
|
||||
tables["glyf"],
|
||||
tables.loca,
|
||||
tables.glyf,
|
||||
numGlyphs,
|
||||
isGlyphLocationsLong,
|
||||
hintsValid,
|
||||
|
@ -2712,30 +2708,30 @@ var Font = (function FontClosure() {
|
|||
|
||||
// Some fonts have incorrect maxSizeOfInstructions values, so we use
|
||||
// the computed value instead.
|
||||
if (version >= 0x00010000 && tables["maxp"].length >= 22) {
|
||||
tables["maxp"].data[26] = glyphsInfo.maxSizeOfInstructions >> 8;
|
||||
tables["maxp"].data[27] = glyphsInfo.maxSizeOfInstructions & 255;
|
||||
if (version >= 0x00010000 && tables.maxp.length >= 22) {
|
||||
tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8;
|
||||
tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255;
|
||||
}
|
||||
}
|
||||
if (!tables["hhea"]) {
|
||||
if (!tables.hhea) {
|
||||
throw new FormatError('Required "hhea" table is not found');
|
||||
}
|
||||
|
||||
// Sanitizer reduces the glyph advanceWidth to the maxAdvanceWidth
|
||||
// Sometimes it's 0. That needs to be fixed
|
||||
if (tables["hhea"].data[10] === 0 && tables["hhea"].data[11] === 0) {
|
||||
tables["hhea"].data[10] = 0xff;
|
||||
tables["hhea"].data[11] = 0xff;
|
||||
if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) {
|
||||
tables.hhea.data[10] = 0xff;
|
||||
tables.hhea.data[11] = 0xff;
|
||||
}
|
||||
|
||||
// Extract some more font properties from the OpenType head and
|
||||
// hhea tables; yMin and descent value are always negative.
|
||||
var metricsOverride = {
|
||||
unitsPerEm: int16(tables["head"].data[18], tables["head"].data[19]),
|
||||
yMax: int16(tables["head"].data[42], tables["head"].data[43]),
|
||||
yMin: signedInt16(tables["head"].data[38], tables["head"].data[39]),
|
||||
ascent: int16(tables["hhea"].data[4], tables["hhea"].data[5]),
|
||||
descent: signedInt16(tables["hhea"].data[6], tables["hhea"].data[7]),
|
||||
unitsPerEm: int16(tables.head.data[18], tables.head.data[19]),
|
||||
yMax: int16(tables.head.data[42], tables.head.data[43]),
|
||||
yMin: signedInt16(tables.head.data[38], tables.head.data[39]),
|
||||
ascent: int16(tables.hhea.data[4], tables.hhea.data[5]),
|
||||
descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]),
|
||||
};
|
||||
|
||||
// PDF FontDescriptor metrics lie -- using data from actual font.
|
||||
|
@ -2743,12 +2739,12 @@ var Font = (function FontClosure() {
|
|||
this.descent = metricsOverride.descent / metricsOverride.unitsPerEm;
|
||||
|
||||
// The 'post' table has glyphs names.
|
||||
if (tables["post"]) {
|
||||
readPostScriptTable(tables["post"], properties, numGlyphs);
|
||||
if (tables.post) {
|
||||
readPostScriptTable(tables.post, properties, numGlyphs);
|
||||
}
|
||||
|
||||
// The original 'post' table is not needed, replace it.
|
||||
tables["post"] = {
|
||||
tables.post = {
|
||||
tag: "post",
|
||||
data: createPostTable(properties),
|
||||
};
|
||||
|
@ -2783,7 +2779,7 @@ var Font = (function FontClosure() {
|
|||
// Most of the following logic in this code branch is based on the
|
||||
// 9.6.6.4 of the PDF spec.
|
||||
var cmapTable = readCmapTable(
|
||||
tables["cmap"],
|
||||
tables.cmap,
|
||||
font,
|
||||
this.isSymbolicFont,
|
||||
properties.hasEncoding
|
||||
|
@ -2916,7 +2912,7 @@ var Font = (function FontClosure() {
|
|||
// Converting glyphs and ids into font's cmap table
|
||||
var newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId);
|
||||
this.toFontChar = newMapping.toFontChar;
|
||||
tables["cmap"] = {
|
||||
tables.cmap = {
|
||||
tag: "cmap",
|
||||
data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphsOut),
|
||||
};
|
||||
|
@ -2951,15 +2947,15 @@ var Font = (function FontClosure() {
|
|||
}
|
||||
|
||||
// Re-creating 'name' table
|
||||
if (!tables["name"]) {
|
||||
tables["name"] = {
|
||||
if (!tables.name) {
|
||||
tables.name = {
|
||||
tag: "name",
|
||||
data: createNameTable(this.name),
|
||||
};
|
||||
} else {
|
||||
// ... using existing 'name' table as prototype
|
||||
var namePrototype = readNameTable(tables["name"]);
|
||||
tables["name"].data = createNameTable(name, namePrototype);
|
||||
var namePrototype = readNameTable(tables.name);
|
||||
tables.name.data = createNameTable(name, namePrototype);
|
||||
}
|
||||
|
||||
var builder = new OpenTypeFileBuilder(header.version);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1188,13 +1188,13 @@ var JpxImage = (function JpxImageClosure() {
|
|||
var codeblockIncluded = false;
|
||||
var firstTimeInclusion = false;
|
||||
var valueReady;
|
||||
if (codeblock["included"] !== undefined) {
|
||||
if (codeblock.included !== undefined) {
|
||||
codeblockIncluded = !!readBits(1);
|
||||
} else {
|
||||
// reading inclusion tree
|
||||
precinct = codeblock.precinct;
|
||||
var inclusionTree, zeroBitPlanesTree;
|
||||
if (precinct["inclusionTree"] !== undefined) {
|
||||
if (precinct.inclusionTree !== undefined) {
|
||||
inclusionTree = precinct.inclusionTree;
|
||||
} else {
|
||||
// building inclusion and zero bit-planes trees
|
||||
|
@ -1264,7 +1264,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
while (queue.length > 0) {
|
||||
var packetItem = queue.shift();
|
||||
codeblock = packetItem.codeblock;
|
||||
if (codeblock["data"] === undefined) {
|
||||
if (codeblock.data === undefined) {
|
||||
codeblock.data = [];
|
||||
}
|
||||
codeblock.data.push({
|
||||
|
@ -1302,7 +1302,7 @@ var JpxImage = (function JpxImageClosure() {
|
|||
if (blockWidth === 0 || blockHeight === 0) {
|
||||
continue;
|
||||
}
|
||||
if (codeblock["data"] === undefined) {
|
||||
if (codeblock.data === undefined) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
5832
src/core/metrics.js
5832
src/core/metrics.js
File diff suppressed because it is too large
Load diff
|
@ -21,11 +21,11 @@ import { getLookupTableFactory } from "./core_utils.js";
|
|||
* fonts and their acronyms.
|
||||
*/
|
||||
const getStdFontMap = getLookupTableFactory(function (t) {
|
||||
t["ArialNarrow"] = "Helvetica";
|
||||
t.ArialNarrow = "Helvetica";
|
||||
t["ArialNarrow-Bold"] = "Helvetica-Bold";
|
||||
t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["ArialNarrow-Italic"] = "Helvetica-Oblique";
|
||||
t["ArialBlack"] = "Helvetica";
|
||||
t.ArialBlack = "Helvetica";
|
||||
t["ArialBlack-Bold"] = "Helvetica-Bold";
|
||||
t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["ArialBlack-Italic"] = "Helvetica-Oblique";
|
||||
|
@ -33,26 +33,26 @@ const getStdFontMap = getLookupTableFactory(function (t) {
|
|||
t["Arial-Black-Bold"] = "Helvetica-Bold";
|
||||
t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Arial-Black-Italic"] = "Helvetica-Oblique";
|
||||
t["Arial"] = "Helvetica";
|
||||
t.Arial = "Helvetica";
|
||||
t["Arial-Bold"] = "Helvetica-Bold";
|
||||
t["Arial-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Arial-Italic"] = "Helvetica-Oblique";
|
||||
t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique";
|
||||
t["Arial-BoldMT"] = "Helvetica-Bold";
|
||||
t["Arial-ItalicMT"] = "Helvetica-Oblique";
|
||||
t["ArialMT"] = "Helvetica";
|
||||
t.ArialMT = "Helvetica";
|
||||
t["Courier-Bold"] = "Courier-Bold";
|
||||
t["Courier-BoldItalic"] = "Courier-BoldOblique";
|
||||
t["Courier-Italic"] = "Courier-Oblique";
|
||||
t["CourierNew"] = "Courier";
|
||||
t.CourierNew = "Courier";
|
||||
t["CourierNew-Bold"] = "Courier-Bold";
|
||||
t["CourierNew-BoldItalic"] = "Courier-BoldOblique";
|
||||
t["CourierNew-Italic"] = "Courier-Oblique";
|
||||
t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique";
|
||||
t["CourierNewPS-BoldMT"] = "Courier-Bold";
|
||||
t["CourierNewPS-ItalicMT"] = "Courier-Oblique";
|
||||
t["CourierNewPSMT"] = "Courier";
|
||||
t["Helvetica"] = "Helvetica";
|
||||
t.CourierNewPSMT = "Courier";
|
||||
t.Helvetica = "Helvetica";
|
||||
t["Helvetica-Bold"] = "Helvetica-Bold";
|
||||
t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique";
|
||||
|
@ -61,18 +61,18 @@ const getStdFontMap = getLookupTableFactory(function (t) {
|
|||
t["Symbol-Bold"] = "Symbol";
|
||||
t["Symbol-BoldItalic"] = "Symbol";
|
||||
t["Symbol-Italic"] = "Symbol";
|
||||
t["TimesNewRoman"] = "Times-Roman";
|
||||
t.TimesNewRoman = "Times-Roman";
|
||||
t["TimesNewRoman-Bold"] = "Times-Bold";
|
||||
t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic";
|
||||
t["TimesNewRoman-Italic"] = "Times-Italic";
|
||||
t["TimesNewRomanPS"] = "Times-Roman";
|
||||
t.TimesNewRomanPS = "Times-Roman";
|
||||
t["TimesNewRomanPS-Bold"] = "Times-Bold";
|
||||
t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic";
|
||||
t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic";
|
||||
t["TimesNewRomanPS-BoldMT"] = "Times-Bold";
|
||||
t["TimesNewRomanPS-Italic"] = "Times-Italic";
|
||||
t["TimesNewRomanPS-ItalicMT"] = "Times-Italic";
|
||||
t["TimesNewRomanPSMT"] = "Times-Roman";
|
||||
t.TimesNewRomanPSMT = "Times-Roman";
|
||||
t["TimesNewRomanPSMT-Bold"] = "Times-Bold";
|
||||
t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic";
|
||||
t["TimesNewRomanPSMT-Italic"] = "Times-Italic";
|
||||
|
@ -83,19 +83,19 @@ const getStdFontMap = getLookupTableFactory(function (t) {
|
|||
* a standard fonts without glyph data.
|
||||
*/
|
||||
const getNonStdFontMap = getLookupTableFactory(function (t) {
|
||||
t["Calibri"] = "Helvetica";
|
||||
t.Calibri = "Helvetica";
|
||||
t["Calibri-Bold"] = "Helvetica-Bold";
|
||||
t["Calibri-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["Calibri-Italic"] = "Helvetica-Oblique";
|
||||
t["CenturyGothic"] = "Helvetica";
|
||||
t.CenturyGothic = "Helvetica";
|
||||
t["CenturyGothic-Bold"] = "Helvetica-Bold";
|
||||
t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique";
|
||||
t["CenturyGothic-Italic"] = "Helvetica-Oblique";
|
||||
t["ComicSansMS"] = "Comic Sans MS";
|
||||
t.ComicSansMS = "Comic Sans MS";
|
||||
t["ComicSansMS-Bold"] = "Comic Sans MS-Bold";
|
||||
t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic";
|
||||
t["ComicSansMS-Italic"] = "Comic Sans MS-Italic";
|
||||
t["LucidaConsole"] = "Courier";
|
||||
t.LucidaConsole = "Courier";
|
||||
t["LucidaConsole-Bold"] = "Courier-Bold";
|
||||
t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique";
|
||||
t["LucidaConsole-Italic"] = "Courier-Oblique";
|
||||
|
@ -116,103 +116,103 @@ const getNonStdFontMap = getLookupTableFactory(function (t) {
|
|||
t["MS-PMincho-Bold"] = "MS PMincho-Bold";
|
||||
t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic";
|
||||
t["MS-PMincho-Italic"] = "MS PMincho-Italic";
|
||||
t["NuptialScript"] = "Times-Italic";
|
||||
t["SegoeUISymbol"] = "Helvetica";
|
||||
t["Wingdings"] = "ZapfDingbats";
|
||||
t.NuptialScript = "Times-Italic";
|
||||
t.SegoeUISymbol = "Helvetica";
|
||||
t.Wingdings = "ZapfDingbats";
|
||||
t["Wingdings-Regular"] = "ZapfDingbats";
|
||||
});
|
||||
|
||||
const getSerifFonts = getLookupTableFactory(function (t) {
|
||||
t["Adobe Jenson"] = true;
|
||||
t["Adobe Text"] = true;
|
||||
t["Albertus"] = true;
|
||||
t["Aldus"] = true;
|
||||
t["Alexandria"] = true;
|
||||
t["Algerian"] = true;
|
||||
t.Albertus = true;
|
||||
t.Aldus = true;
|
||||
t.Alexandria = true;
|
||||
t.Algerian = true;
|
||||
t["American Typewriter"] = true;
|
||||
t["Antiqua"] = true;
|
||||
t["Apex"] = true;
|
||||
t["Arno"] = true;
|
||||
t["Aster"] = true;
|
||||
t["Aurora"] = true;
|
||||
t["Baskerville"] = true;
|
||||
t["Bell"] = true;
|
||||
t["Bembo"] = true;
|
||||
t.Antiqua = true;
|
||||
t.Apex = true;
|
||||
t.Arno = true;
|
||||
t.Aster = true;
|
||||
t.Aurora = true;
|
||||
t.Baskerville = true;
|
||||
t.Bell = true;
|
||||
t.Bembo = true;
|
||||
t["Bembo Schoolbook"] = true;
|
||||
t["Benguiat"] = true;
|
||||
t.Benguiat = true;
|
||||
t["Berkeley Old Style"] = true;
|
||||
t["Bernhard Modern"] = true;
|
||||
t["Berthold City"] = true;
|
||||
t["Bodoni"] = true;
|
||||
t.Bodoni = true;
|
||||
t["Bauer Bodoni"] = true;
|
||||
t["Book Antiqua"] = true;
|
||||
t["Bookman"] = true;
|
||||
t.Bookman = true;
|
||||
t["Bordeaux Roman"] = true;
|
||||
t["Californian FB"] = true;
|
||||
t["Calisto"] = true;
|
||||
t["Calvert"] = true;
|
||||
t["Capitals"] = true;
|
||||
t["Cambria"] = true;
|
||||
t["Cartier"] = true;
|
||||
t["Caslon"] = true;
|
||||
t["Catull"] = true;
|
||||
t["Centaur"] = true;
|
||||
t.Calisto = true;
|
||||
t.Calvert = true;
|
||||
t.Capitals = true;
|
||||
t.Cambria = true;
|
||||
t.Cartier = true;
|
||||
t.Caslon = true;
|
||||
t.Catull = true;
|
||||
t.Centaur = true;
|
||||
t["Century Old Style"] = true;
|
||||
t["Century Schoolbook"] = true;
|
||||
t["Chaparral"] = true;
|
||||
t.Chaparral = true;
|
||||
t["Charis SIL"] = true;
|
||||
t["Cheltenham"] = true;
|
||||
t.Cheltenham = true;
|
||||
t["Cholla Slab"] = true;
|
||||
t["Clarendon"] = true;
|
||||
t["Clearface"] = true;
|
||||
t["Cochin"] = true;
|
||||
t["Colonna"] = true;
|
||||
t.Clarendon = true;
|
||||
t.Clearface = true;
|
||||
t.Cochin = true;
|
||||
t.Colonna = true;
|
||||
t["Computer Modern"] = true;
|
||||
t["Concrete Roman"] = true;
|
||||
t["Constantia"] = true;
|
||||
t.Constantia = true;
|
||||
t["Cooper Black"] = true;
|
||||
t["Corona"] = true;
|
||||
t["Ecotype"] = true;
|
||||
t["Egyptienne"] = true;
|
||||
t["Elephant"] = true;
|
||||
t["Excelsior"] = true;
|
||||
t["Fairfield"] = true;
|
||||
t.Corona = true;
|
||||
t.Ecotype = true;
|
||||
t.Egyptienne = true;
|
||||
t.Elephant = true;
|
||||
t.Excelsior = true;
|
||||
t.Fairfield = true;
|
||||
t["FF Scala"] = true;
|
||||
t["Folkard"] = true;
|
||||
t["Footlight"] = true;
|
||||
t["FreeSerif"] = true;
|
||||
t.Folkard = true;
|
||||
t.Footlight = true;
|
||||
t.FreeSerif = true;
|
||||
t["Friz Quadrata"] = true;
|
||||
t["Garamond"] = true;
|
||||
t["Gentium"] = true;
|
||||
t["Georgia"] = true;
|
||||
t["Gloucester"] = true;
|
||||
t.Garamond = true;
|
||||
t.Gentium = true;
|
||||
t.Georgia = true;
|
||||
t.Gloucester = true;
|
||||
t["Goudy Old Style"] = true;
|
||||
t["Goudy Schoolbook"] = true;
|
||||
t["Goudy Pro Font"] = true;
|
||||
t["Granjon"] = true;
|
||||
t.Granjon = true;
|
||||
t["Guardian Egyptian"] = true;
|
||||
t["Heather"] = true;
|
||||
t["Hercules"] = true;
|
||||
t.Heather = true;
|
||||
t.Hercules = true;
|
||||
t["High Tower Text"] = true;
|
||||
t["Hiroshige"] = true;
|
||||
t.Hiroshige = true;
|
||||
t["Hoefler Text"] = true;
|
||||
t["Humana Serif"] = true;
|
||||
t["Imprint"] = true;
|
||||
t.Imprint = true;
|
||||
t["Ionic No. 5"] = true;
|
||||
t["Janson"] = true;
|
||||
t["Joanna"] = true;
|
||||
t["Korinna"] = true;
|
||||
t["Lexicon"] = true;
|
||||
t.Janson = true;
|
||||
t.Joanna = true;
|
||||
t.Korinna = true;
|
||||
t.Lexicon = true;
|
||||
t["Liberation Serif"] = true;
|
||||
t["Linux Libertine"] = true;
|
||||
t["Literaturnaya"] = true;
|
||||
t["Lucida"] = true;
|
||||
t.Literaturnaya = true;
|
||||
t.Lucida = true;
|
||||
t["Lucida Bright"] = true;
|
||||
t["Melior"] = true;
|
||||
t["Memphis"] = true;
|
||||
t["Miller"] = true;
|
||||
t["Minion"] = true;
|
||||
t["Modern"] = true;
|
||||
t.Melior = true;
|
||||
t.Memphis = true;
|
||||
t.Miller = true;
|
||||
t.Minion = true;
|
||||
t.Modern = true;
|
||||
t["Mona Lisa"] = true;
|
||||
t["Mrs Eaves"] = true;
|
||||
t["MS Serif"] = true;
|
||||
|
@ -220,48 +220,48 @@ const getSerifFonts = getLookupTableFactory(function (t) {
|
|||
t["New York"] = true;
|
||||
t["Nimbus Roman"] = true;
|
||||
t["NPS Rawlinson Roadway"] = true;
|
||||
t["NuptialScript"] = true;
|
||||
t["Palatino"] = true;
|
||||
t["Perpetua"] = true;
|
||||
t["Plantin"] = true;
|
||||
t.NuptialScript = true;
|
||||
t.Palatino = true;
|
||||
t.Perpetua = true;
|
||||
t.Plantin = true;
|
||||
t["Plantin Schoolbook"] = true;
|
||||
t["Playbill"] = true;
|
||||
t.Playbill = true;
|
||||
t["Poor Richard"] = true;
|
||||
t["Rawlinson Roadway"] = true;
|
||||
t["Renault"] = true;
|
||||
t["Requiem"] = true;
|
||||
t["Rockwell"] = true;
|
||||
t["Roman"] = true;
|
||||
t.Renault = true;
|
||||
t.Requiem = true;
|
||||
t.Rockwell = true;
|
||||
t.Roman = true;
|
||||
t["Rotis Serif"] = true;
|
||||
t["Sabon"] = true;
|
||||
t["Scala"] = true;
|
||||
t["Seagull"] = true;
|
||||
t["Sistina"] = true;
|
||||
t["Souvenir"] = true;
|
||||
t["STIX"] = true;
|
||||
t.Sabon = true;
|
||||
t.Scala = true;
|
||||
t.Seagull = true;
|
||||
t.Sistina = true;
|
||||
t.Souvenir = true;
|
||||
t.STIX = true;
|
||||
t["Stone Informal"] = true;
|
||||
t["Stone Serif"] = true;
|
||||
t["Sylfaen"] = true;
|
||||
t["Times"] = true;
|
||||
t["Trajan"] = true;
|
||||
t.Sylfaen = true;
|
||||
t.Times = true;
|
||||
t.Trajan = true;
|
||||
t["Trinité"] = true;
|
||||
t["Trump Mediaeval"] = true;
|
||||
t["Utopia"] = true;
|
||||
t.Utopia = true;
|
||||
t["Vale Type"] = true;
|
||||
t["Bitstream Vera"] = true;
|
||||
t["Vera Serif"] = true;
|
||||
t["Versailles"] = true;
|
||||
t["Wanted"] = true;
|
||||
t["Weiss"] = true;
|
||||
t.Versailles = true;
|
||||
t.Wanted = true;
|
||||
t.Weiss = true;
|
||||
t["Wide Latin"] = true;
|
||||
t["Windsor"] = true;
|
||||
t["XITS"] = true;
|
||||
t.Windsor = true;
|
||||
t.XITS = true;
|
||||
});
|
||||
|
||||
const getSymbolsFonts = getLookupTableFactory(function (t) {
|
||||
t["Dingbats"] = true;
|
||||
t["Symbol"] = true;
|
||||
t["ZapfDingbats"] = true;
|
||||
t.Dingbats = true;
|
||||
t.Symbol = true;
|
||||
t.ZapfDingbats = true;
|
||||
});
|
||||
|
||||
// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID
|
||||
|
|
|
@ -566,7 +566,7 @@ var Type1Parser = (function Type1ParserClosure() {
|
|||
var subrs = [],
|
||||
charstrings = [];
|
||||
var privateData = Object.create(null);
|
||||
privateData["lenIV"] = 4;
|
||||
privateData.lenIV = 4;
|
||||
var program = {
|
||||
subrs: [],
|
||||
charstrings: [],
|
||||
|
@ -601,7 +601,7 @@ var Type1Parser = (function Type1ParserClosure() {
|
|||
length = this.readInt();
|
||||
this.getToken(); // read in 'RD' or '-|'
|
||||
data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);
|
||||
lenIV = program.properties.privateData["lenIV"];
|
||||
lenIV = program.properties.privateData.lenIV;
|
||||
encoded = this.readCharStrings(data, lenIV);
|
||||
this.nextChar();
|
||||
token = this.getToken(); // read in 'ND' or '|-'
|
||||
|
@ -622,7 +622,7 @@ var Type1Parser = (function Type1ParserClosure() {
|
|||
length = this.readInt();
|
||||
this.getToken(); // read in 'RD' or '-|'
|
||||
data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);
|
||||
lenIV = program.properties.privateData["lenIV"];
|
||||
lenIV = program.properties.privateData.lenIV;
|
||||
encoded = this.readCharStrings(data, lenIV);
|
||||
this.nextChar();
|
||||
token = this.getToken(); // read in 'NP' or '|'
|
||||
|
|
|
@ -376,7 +376,7 @@ class PDFNodeStreamRangeReader extends BaseRangeReader {
|
|||
}
|
||||
this._httpHeaders[property] = value;
|
||||
}
|
||||
this._httpHeaders["Range"] = `bytes=${start}-${end - 1}`;
|
||||
this._httpHeaders.Range = `bytes=${start}-${end - 1}`;
|
||||
|
||||
const handleResponse = response => {
|
||||
if (response.statusCode === 404) {
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
const isNodeJS =
|
||||
typeof process === "object" &&
|
||||
process + "" === "[object process]" &&
|
||||
!process.versions["nw"] &&
|
||||
!process.versions["electron"];
|
||||
!process.versions.nw &&
|
||||
!process.versions.electron;
|
||||
|
||||
export { isNodeJS };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue