|
|
@ -11612,7 +11612,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) { |
|
|
|
if (worker.destroyed) { |
|
|
|
if (worker.destroyed) { |
|
|
|
return Promise.reject(new Error('Worker was destroyed')); |
|
|
|
return Promise.reject(new Error('Worker was destroyed')); |
|
|
|
} |
|
|
|
} |
|
|
|
var apiVersion = '2.0.254'; |
|
|
|
var apiVersion = '2.0.256'; |
|
|
|
source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange'); |
|
|
|
source.disableRange = (0, _dom_utils.getDefaultSetting)('disableRange'); |
|
|
|
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch'); |
|
|
|
source.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch'); |
|
|
|
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream'); |
|
|
|
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream'); |
|
|
@ -12904,8 +12904,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() { |
|
|
|
}(); |
|
|
|
}(); |
|
|
|
var version, build; |
|
|
|
var version, build; |
|
|
|
{ |
|
|
|
{ |
|
|
|
exports.version = version = '2.0.254'; |
|
|
|
exports.version = version = '2.0.256'; |
|
|
|
exports.build = build = '915e3f4c'; |
|
|
|
exports.build = build = '3925aab0'; |
|
|
|
} |
|
|
|
} |
|
|
|
exports.getDocument = getDocument; |
|
|
|
exports.getDocument = getDocument; |
|
|
|
exports.LoopbackPort = LoopbackPort; |
|
|
|
exports.LoopbackPort = LoopbackPort; |
|
|
@ -26688,8 +26688,8 @@ exports.SVGGraphics = SVGGraphics; |
|
|
|
"use strict"; |
|
|
|
"use strict"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var pdfjsVersion = '2.0.254'; |
|
|
|
var pdfjsVersion = '2.0.256'; |
|
|
|
var pdfjsBuild = '915e3f4c'; |
|
|
|
var pdfjsBuild = '3925aab0'; |
|
|
|
var pdfjsSharedUtil = __w_pdfjs_require__(0); |
|
|
|
var pdfjsSharedUtil = __w_pdfjs_require__(0); |
|
|
|
var pdfjsDisplayGlobal = __w_pdfjs_require__(131); |
|
|
|
var pdfjsDisplayGlobal = __w_pdfjs_require__(131); |
|
|
|
var pdfjsDisplayAPI = __w_pdfjs_require__(65); |
|
|
|
var pdfjsDisplayAPI = __w_pdfjs_require__(65); |
|
|
@ -31868,8 +31868,8 @@ if (!_global_scope2.default.PDFJS) { |
|
|
|
} |
|
|
|
} |
|
|
|
var PDFJS = _global_scope2.default.PDFJS; |
|
|
|
var PDFJS = _global_scope2.default.PDFJS; |
|
|
|
{ |
|
|
|
{ |
|
|
|
PDFJS.version = '2.0.254'; |
|
|
|
PDFJS.version = '2.0.256'; |
|
|
|
PDFJS.build = '915e3f4c'; |
|
|
|
PDFJS.build = '3925aab0'; |
|
|
|
} |
|
|
|
} |
|
|
|
PDFJS.pdfBug = false; |
|
|
|
PDFJS.pdfBug = false; |
|
|
|
if (PDFJS.verbosity !== undefined) { |
|
|
|
if (PDFJS.verbosity !== undefined) { |
|
|
@ -35230,7 +35230,7 @@ var WorkerMessageHandler = { |
|
|
|
var cancelXHRs = null; |
|
|
|
var cancelXHRs = null; |
|
|
|
var WorkerTasks = []; |
|
|
|
var WorkerTasks = []; |
|
|
|
var apiVersion = docParams.apiVersion; |
|
|
|
var apiVersion = docParams.apiVersion; |
|
|
|
var workerVersion = '2.0.254'; |
|
|
|
var workerVersion = '2.0.256'; |
|
|
|
if (apiVersion !== null && apiVersion !== workerVersion) { |
|
|
|
if (apiVersion !== null && apiVersion !== workerVersion) { |
|
|
|
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".')); |
|
|
|
throw new Error('The API version "' + apiVersion + '" does not match ' + ('the Worker version "' + workerVersion + '".')); |
|
|
|
} |
|
|
|
} |
|
|
@ -44141,6 +44141,10 @@ var Font = function FontClosure() { |
|
|
|
var header = file.peekBytes(4); |
|
|
|
var header = file.peekBytes(4); |
|
|
|
return (0, _util.readUint32)(header, 0) === 0x00010000; |
|
|
|
return (0, _util.readUint32)(header, 0) === 0x00010000; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function isTrueTypeCollectionFile(file) { |
|
|
|
|
|
|
|
var header = file.peekBytes(4); |
|
|
|
|
|
|
|
return (0, _util.bytesToString)(header) === 'ttcf'; |
|
|
|
|
|
|
|
} |
|
|
|
function isOpenTypeFile(file) { |
|
|
|
function isOpenTypeFile(file) { |
|
|
|
var header = file.peekBytes(4); |
|
|
|
var header = file.peekBytes(4); |
|
|
|
return (0, _util.bytesToString)(header) === 'OTTO'; |
|
|
|
return (0, _util.bytesToString)(header) === 'OTTO'; |
|
|
@ -44551,6 +44555,29 @@ var Font = function FontClosure() { |
|
|
|
this.fontType = getFontType(type, subtype); |
|
|
|
this.fontType = getFontType(type, subtype); |
|
|
|
}, |
|
|
|
}, |
|
|
|
checkAndRepair: function Font_checkAndRepair(name, font, properties) { |
|
|
|
checkAndRepair: function Font_checkAndRepair(name, font, properties) { |
|
|
|
|
|
|
|
var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; |
|
|
|
|
|
|
|
function readTables(file, numTables) { |
|
|
|
|
|
|
|
var 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; |
|
|
|
|
|
|
|
for (var i = 0; i < numTables; i++) { |
|
|
|
|
|
|
|
var table = readTableEntry(font); |
|
|
|
|
|
|
|
if (VALID_TABLES.indexOf(table.tag) < 0) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (table.length === 0) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tables[table.tag] = table; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return tables; |
|
|
|
|
|
|
|
} |
|
|
|
function readTableEntry(file) { |
|
|
|
function readTableEntry(file) { |
|
|
|
var tag = (0, _util.bytesToString)(file.getBytes(4)); |
|
|
|
var tag = (0, _util.bytesToString)(file.getBytes(4)); |
|
|
|
var checksum = file.getInt32() >>> 0; |
|
|
|
var checksum = file.getInt32() >>> 0; |
|
|
@ -44582,6 +44609,61 @@ var Font = function FontClosure() { |
|
|
|
rangeShift: ttf.getUint16() |
|
|
|
rangeShift: ttf.getUint16() |
|
|
|
}; |
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function readTrueTypeCollectionHeader(ttc) { |
|
|
|
|
|
|
|
var ttcTag = (0, _util.bytesToString)(ttc.getBytes(4)); |
|
|
|
|
|
|
|
(0, _util.assert)(ttcTag === 'ttcf', 'Must be a TrueType Collection font.'); |
|
|
|
|
|
|
|
var majorVersion = ttc.getUint16(); |
|
|
|
|
|
|
|
var minorVersion = ttc.getUint16(); |
|
|
|
|
|
|
|
var numFonts = ttc.getInt32() >>> 0; |
|
|
|
|
|
|
|
var offsetTable = []; |
|
|
|
|
|
|
|
for (var i = 0; i < numFonts; i++) { |
|
|
|
|
|
|
|
offsetTable.push(ttc.getInt32() >>> 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var header = { |
|
|
|
|
|
|
|
ttcTag: ttcTag, |
|
|
|
|
|
|
|
majorVersion: majorVersion, |
|
|
|
|
|
|
|
minorVersion: minorVersion, |
|
|
|
|
|
|
|
numFonts: numFonts, |
|
|
|
|
|
|
|
offsetTable: offsetTable |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
switch (majorVersion) { |
|
|
|
|
|
|
|
case 1: |
|
|
|
|
|
|
|
return header; |
|
|
|
|
|
|
|
case 2: |
|
|
|
|
|
|
|
header.dsigTag = ttc.getInt32() >>> 0; |
|
|
|
|
|
|
|
header.dsigLength = ttc.getInt32() >>> 0; |
|
|
|
|
|
|
|
header.dsigOffset = ttc.getInt32() >>> 0; |
|
|
|
|
|
|
|
return header; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
throw new _util.FormatError('Invalid TrueType Collection majorVersion: ' + majorVersion + '.'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function readTrueTypeCollectionData(ttc, fontName) { |
|
|
|
|
|
|
|
var _readTrueTypeCollecti = readTrueTypeCollectionHeader(ttc), |
|
|
|
|
|
|
|
numFonts = _readTrueTypeCollecti.numFonts, |
|
|
|
|
|
|
|
offsetTable = _readTrueTypeCollecti.offsetTable; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < numFonts; i++) { |
|
|
|
|
|
|
|
ttc.pos = (ttc.start || 0) + offsetTable[i]; |
|
|
|
|
|
|
|
var potentialHeader = readOpenTypeHeader(ttc); |
|
|
|
|
|
|
|
var potentialTables = readTables(ttc, potentialHeader.numTables); |
|
|
|
|
|
|
|
if (!potentialTables['name']) { |
|
|
|
|
|
|
|
throw new _util.FormatError('TrueType Collection font must contain a "name" table.'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var nameTable = readNameTable(potentialTables['name']); |
|
|
|
|
|
|
|
for (var j = 0, jj = nameTable.length; j < jj; j++) { |
|
|
|
|
|
|
|
for (var k = 0, kk = nameTable[j].length; k < kk; k++) { |
|
|
|
|
|
|
|
var nameEntry = nameTable[j][k]; |
|
|
|
|
|
|
|
if (nameEntry && nameEntry.replace(/\s/g, '') === fontName) { |
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
header: potentialHeader, |
|
|
|
|
|
|
|
tables: potentialTables |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
throw new _util.FormatError('TrueType Collection does not contain "' + fontName + '" font.'); |
|
|
|
|
|
|
|
} |
|
|
|
function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { |
|
|
|
function readCmapTable(cmap, font, isSymbolicFont, hasEncoding) { |
|
|
|
if (!cmap) { |
|
|
|
if (!cmap) { |
|
|
|
(0, _util.warn)('No cmap table available.'); |
|
|
|
(0, _util.warn)('No cmap table available.'); |
|
|
@ -45297,30 +45379,18 @@ var Font = function FontClosure() { |
|
|
|
return ttContext.hintsValid; |
|
|
|
return ttContext.hintsValid; |
|
|
|
} |
|
|
|
} |
|
|
|
font = new _stream.Stream(new Uint8Array(font.getBytes())); |
|
|
|
font = new _stream.Stream(new Uint8Array(font.getBytes())); |
|
|
|
var VALID_TABLES = ['OS/2', 'cmap', 'head', 'hhea', 'hmtx', 'maxp', 'name', 'post', 'loca', 'glyf', 'fpgm', 'prep', 'cvt ', 'CFF ']; |
|
|
|
var header = void 0, |
|
|
|
var header = readOpenTypeHeader(font); |
|
|
|
tables = void 0; |
|
|
|
var numTables = header.numTables; |
|
|
|
if (isTrueTypeCollectionFile(font)) { |
|
|
|
var cff, cffFile; |
|
|
|
var ttcData = readTrueTypeCollectionData(font, this.name); |
|
|
|
var tables = Object.create(null); |
|
|
|
header = ttcData.header; |
|
|
|
tables['OS/2'] = null; |
|
|
|
tables = ttcData.tables; |
|
|
|
tables['cmap'] = null; |
|
|
|
} else { |
|
|
|
tables['head'] = null; |
|
|
|
header = readOpenTypeHeader(font); |
|
|
|
tables['hhea'] = null; |
|
|
|
tables = readTables(font, header.numTables); |
|
|
|
tables['hmtx'] = null; |
|
|
|
} |
|
|
|
tables['maxp'] = null; |
|
|
|
var cff = void 0, |
|
|
|
tables['name'] = null; |
|
|
|
cffFile = void 0; |
|
|
|
tables['post'] = null; |
|
|
|
|
|
|
|
var table; |
|
|
|
|
|
|
|
for (var i = 0; i < numTables; i++) { |
|
|
|
|
|
|
|
table = readTableEntry(font); |
|
|
|
|
|
|
|
if (VALID_TABLES.indexOf(table.tag) < 0) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (table.length === 0) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
tables[table.tag] = table; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var isTrueType = !tables['CFF ']; |
|
|
|
var isTrueType = !tables['CFF ']; |
|
|
|
if (!isTrueType) { |
|
|
|
if (!isTrueType) { |
|
|
|
if (header.version === 'OTTO' && !(properties.composite && properties.cidToGidMap) || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) { |
|
|
|
if (header.version === 'OTTO' && !(properties.composite && properties.cidToGidMap) || !tables['head'] || !tables['hhea'] || !tables['maxp'] || !tables['post']) { |
|
|
@ -45475,7 +45545,7 @@ var Font = function FontClosure() { |
|
|
|
unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName); |
|
|
|
unicodeOrCharCode = _encodings.MacRomanEncoding.indexOf(standardGlyphName); |
|
|
|
} |
|
|
|
} |
|
|
|
var found = false; |
|
|
|
var found = false; |
|
|
|
for (i = 0; i < cmapMappingsLength; ++i) { |
|
|
|
for (var i = 0; i < cmapMappingsLength; ++i) { |
|
|
|
if (cmapMappings[i].charCode !== unicodeOrCharCode) { |
|
|
|
if (cmapMappings[i].charCode !== unicodeOrCharCode) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
@ -45494,16 +45564,16 @@ var Font = function FontClosure() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (cmapPlatformId === 0 && cmapEncodingId === 0) { |
|
|
|
} else if (cmapPlatformId === 0 && cmapEncodingId === 0) { |
|
|
|
for (i = 0; i < cmapMappingsLength; ++i) { |
|
|
|
for (var _i = 0; _i < cmapMappingsLength; ++_i) { |
|
|
|
charCodeToGlyphId[cmapMappings[i].charCode] = cmapMappings[i].glyphId; |
|
|
|
charCodeToGlyphId[cmapMappings[_i].charCode] = cmapMappings[_i].glyphId; |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
for (i = 0; i < cmapMappingsLength; ++i) { |
|
|
|
for (var _i2 = 0; _i2 < cmapMappingsLength; ++_i2) { |
|
|
|
charCode = cmapMappings[i].charCode; |
|
|
|
charCode = cmapMappings[_i2].charCode; |
|
|
|
if (cmapPlatformId === 3 && charCode >= 0xF000 && charCode <= 0xF0FF) { |
|
|
|
if (cmapPlatformId === 3 && charCode >= 0xF000 && charCode <= 0xF0FF) { |
|
|
|
charCode &= 0xFF; |
|
|
|
charCode &= 0xFF; |
|
|
|
} |
|
|
|
} |
|
|
|
charCodeToGlyphId[charCode] = cmapMappings[i].glyphId; |
|
|
|
charCodeToGlyphId[charCode] = cmapMappings[_i2].glyphId; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|