|
@@ -11612,7 +11612,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
|
|
|
if (worker.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.disableAutoFetch = (0, _dom_utils.getDefaultSetting)('disableAutoFetch');
|
|
|
source.disableStream = (0, _dom_utils.getDefaultSetting)('disableStream');
|
|
@@ -12904,8 +12904,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
|
|
|
}();
|
|
|
var version, build;
|
|
|
{
|
|
|
- exports.version = version = '2.0.254';
|
|
|
- exports.build = build = '915e3f4c';
|
|
|
+ exports.version = version = '2.0.256';
|
|
|
+ exports.build = build = '3925aab0';
|
|
|
}
|
|
|
exports.getDocument = getDocument;
|
|
|
exports.LoopbackPort = LoopbackPort;
|
|
@@ -26688,8 +26688,8 @@ exports.SVGGraphics = SVGGraphics;
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
-var pdfjsVersion = '2.0.254';
|
|
|
-var pdfjsBuild = '915e3f4c';
|
|
|
+var pdfjsVersion = '2.0.256';
|
|
|
+var pdfjsBuild = '3925aab0';
|
|
|
var pdfjsSharedUtil = __w_pdfjs_require__(0);
|
|
|
var pdfjsDisplayGlobal = __w_pdfjs_require__(131);
|
|
|
var pdfjsDisplayAPI = __w_pdfjs_require__(65);
|
|
@@ -31868,8 +31868,8 @@ if (!_global_scope2.default.PDFJS) {
|
|
|
}
|
|
|
var PDFJS = _global_scope2.default.PDFJS;
|
|
|
{
|
|
|
- PDFJS.version = '2.0.254';
|
|
|
- PDFJS.build = '915e3f4c';
|
|
|
+ PDFJS.version = '2.0.256';
|
|
|
+ PDFJS.build = '3925aab0';
|
|
|
}
|
|
|
PDFJS.pdfBug = false;
|
|
|
if (PDFJS.verbosity !== undefined) {
|
|
@@ -35230,7 +35230,7 @@ var WorkerMessageHandler = {
|
|
|
var cancelXHRs = null;
|
|
|
var WorkerTasks = [];
|
|
|
var apiVersion = docParams.apiVersion;
|
|
|
- var workerVersion = '2.0.254';
|
|
|
+ var workerVersion = '2.0.256';
|
|
|
if (apiVersion !== null && apiVersion !== 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);
|
|
|
return (0, _util.readUint32)(header, 0) === 0x00010000;
|
|
|
}
|
|
|
+ function isTrueTypeCollectionFile(file) {
|
|
|
+ var header = file.peekBytes(4);
|
|
|
+ return (0, _util.bytesToString)(header) === 'ttcf';
|
|
|
+ }
|
|
|
function isOpenTypeFile(file) {
|
|
|
var header = file.peekBytes(4);
|
|
|
return (0, _util.bytesToString)(header) === 'OTTO';
|
|
@@ -44551,6 +44555,29 @@ var Font = function FontClosure() {
|
|
|
this.fontType = getFontType(type, subtype);
|
|
|
},
|
|
|
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) {
|
|
|
var tag = (0, _util.bytesToString)(file.getBytes(4));
|
|
|
var checksum = file.getInt32() >>> 0;
|
|
@@ -44582,6 +44609,61 @@ var Font = function FontClosure() {
|
|
|
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) {
|
|
|
if (!cmap) {
|
|
|
(0, _util.warn)('No cmap table available.');
|
|
@@ -45297,30 +45379,18 @@ var Font = function FontClosure() {
|
|
|
return ttContext.hintsValid;
|
|
|
}
|
|
|
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 = readOpenTypeHeader(font);
|
|
|
- var numTables = header.numTables;
|
|
|
- var cff, cffFile;
|
|
|
- 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;
|
|
|
- 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 header = void 0,
|
|
|
+ tables = void 0;
|
|
|
+ if (isTrueTypeCollectionFile(font)) {
|
|
|
+ var ttcData = readTrueTypeCollectionData(font, this.name);
|
|
|
+ header = ttcData.header;
|
|
|
+ tables = ttcData.tables;
|
|
|
+ } else {
|
|
|
+ header = readOpenTypeHeader(font);
|
|
|
+ tables = readTables(font, header.numTables);
|
|
|
}
|
|
|
+ var cff = void 0,
|
|
|
+ cffFile = void 0;
|
|
|
var isTrueType = !tables['CFF '];
|
|
|
if (!isTrueType) {
|
|
|
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);
|
|
|
}
|
|
|
var found = false;
|
|
|
- for (i = 0; i < cmapMappingsLength; ++i) {
|
|
|
+ for (var i = 0; i < cmapMappingsLength; ++i) {
|
|
|
if (cmapMappings[i].charCode !== unicodeOrCharCode) {
|
|
|
continue;
|
|
|
}
|
|
@@ -45494,16 +45564,16 @@ var Font = function FontClosure() {
|
|
|
}
|
|
|
}
|
|
|
} else if (cmapPlatformId === 0 && cmapEncodingId === 0) {
|
|
|
- for (i = 0; i < cmapMappingsLength; ++i) {
|
|
|
- charCodeToGlyphId[cmapMappings[i].charCode] = cmapMappings[i].glyphId;
|
|
|
+ for (var _i = 0; _i < cmapMappingsLength; ++_i) {
|
|
|
+ charCodeToGlyphId[cmapMappings[_i].charCode] = cmapMappings[_i].glyphId;
|
|
|
}
|
|
|
} else {
|
|
|
- for (i = 0; i < cmapMappingsLength; ++i) {
|
|
|
- charCode = cmapMappings[i].charCode;
|
|
|
+ for (var _i2 = 0; _i2 < cmapMappingsLength; ++_i2) {
|
|
|
+ charCode = cmapMappings[_i2].charCode;
|
|
|
if (cmapPlatformId === 3 && charCode >= 0xF000 && charCode <= 0xF0FF) {
|
|
|
charCode &= 0xFF;
|
|
|
}
|
|
|
- charCodeToGlyphId[charCode] = cmapMappings[i].glyphId;
|
|
|
+ charCodeToGlyphId[charCode] = cmapMappings[_i2].glyphId;
|
|
|
}
|
|
|
}
|
|
|
}
|