Bug 1489996 - Update pdf.js to version 2.0.841. r=bdahl

This commit is contained in:
Ryan VanderMeulen 2018-09-10 09:02:45 -04:00
Родитель 9fcc4e5b9a
Коммит 9368462357
7 изменённых файлов: 726 добавлений и 600 удалений

Просмотреть файл

@ -1,5 +1,5 @@
This is the PDF.js project output, https://github.com/mozilla/pdf.js
Current extension version is: 2.0.815
Current extension version is: 2.0.841
Taken from upstream commit: d6927376
Taken from upstream commit: bc5111d1

Просмотреть файл

@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
"use strict";
var pdfjsVersion = '2.0.815';
var pdfjsBuild = 'd6927376';
var pdfjsVersion = '2.0.841';
var pdfjsBuild = 'bc5111d1';
var pdfjsSharedUtil = __w_pdfjs_require__(1);
var pdfjsDisplayAPI = __w_pdfjs_require__(7);
var pdfjsDisplayTextLayer = __w_pdfjs_require__(19);
@ -4226,7 +4226,7 @@ function _fetchDocument(worker, source, pdfDataRangeTransport, docId) {
}
return worker.messageHandler.sendWithPromise('GetDocRequest', {
docId,
apiVersion: '2.0.815',
apiVersion: '2.0.841',
source: {
data: source.data,
url: source.url,
@ -5553,8 +5553,8 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
}();
var version, build;
{
exports.version = version = '2.0.815';
exports.build = build = 'd6927376';
exports.version = version = '2.0.841';
exports.build = build = 'bc5111d1';
}
exports.getDocument = getDocument;
exports.LoopbackPort = LoopbackPort;
@ -6354,7 +6354,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
if (canvasCtx) {
addContextCurrentTransform(canvasCtx);
}
this.cachedGetSinglePixelWidth = null;
this._cachedGetSinglePixelWidth = null;
}
function putBinaryImageData(ctx, imgData) {
if (typeof ImageData !== 'undefined' && imgData instanceof ImageData) {
@ -6829,12 +6829,12 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
this.current = this.stateStack.pop();
this.ctx.restore();
this.pendingClip = null;
this.cachedGetSinglePixelWidth = null;
this._cachedGetSinglePixelWidth = null;
}
},
transform: function CanvasGraphics_transform(a, b, c, d, e, f) {
this.ctx.transform(a, b, c, d, e, f);
this.cachedGetSinglePixelWidth = null;
this._cachedGetSinglePixelWidth = null;
},
constructPath: function CanvasGraphics_constructPath(ops, args) {
var ctx = this.ctx;
@ -7177,7 +7177,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
if (scale === 0 || lineWidth === 0) {
var fillStrokeMode = current.textRenderingMode & _util.TextRenderingMode.FILL_STROKE_MASK;
if (fillStrokeMode === _util.TextRenderingMode.STROKE || fillStrokeMode === _util.TextRenderingMode.FILL_STROKE) {
this.cachedGetSinglePixelWidth = null;
this._cachedGetSinglePixelWidth = null;
lineWidth = this.getSinglePixelWidth() * MIN_WIDTH_FACTOR;
}
} else {
@ -7269,7 +7269,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
if (isTextInvisible || fontSize === 0) {
return;
}
this.cachedGetSinglePixelWidth = null;
this._cachedGetSinglePixelWidth = null;
ctx.save();
ctx.transform.apply(ctx, current.textMatrix);
ctx.translate(current.x, current.y);
@ -7737,14 +7737,12 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
}
ctx.beginPath();
},
getSinglePixelWidth: function CanvasGraphics_getSinglePixelWidth(scale) {
if (this.cachedGetSinglePixelWidth === null) {
this.ctx.save();
var inverse = this.ctx.mozCurrentTransformInverse;
this.ctx.restore();
this.cachedGetSinglePixelWidth = Math.sqrt(Math.max(inverse[0] * inverse[0] + inverse[1] * inverse[1], inverse[2] * inverse[2] + inverse[3] * inverse[3]));
getSinglePixelWidth(scale) {
if (this._cachedGetSinglePixelWidth === null) {
const inverse = this.ctx.mozCurrentTransformInverse;
this._cachedGetSinglePixelWidth = Math.sqrt(Math.max(inverse[0] * inverse[0] + inverse[1] * inverse[1], inverse[2] * inverse[2] + inverse[3] * inverse[3]));
}
return this.cachedGetSinglePixelWidth;
return this._cachedGetSinglePixelWidth;
},
getCanvasPosition: function CanvasGraphics_getCanvasPosition(x, y) {
var transform = this.ctx.mozCurrentTransform;
@ -10015,8 +10013,8 @@ var renderTextLayer = function renderTextLayerClosure() {
let fontFamily = textDiv.style.fontFamily;
if (fontSize !== this._layoutTextLastFontSize || fontFamily !== this._layoutTextLastFontFamily) {
this._layoutTextCtx.font = fontSize + ' ' + fontFamily;
this._lastFontSize = fontSize;
this._lastFontFamily = fontFamily;
this._layoutTextLastFontSize = fontSize;
this._layoutTextLastFontFamily = fontFamily;
}
let width = this._layoutTextCtx.measureText(textDiv.textContent).width;
let transform = '';

Просмотреть файл

@ -123,8 +123,8 @@ return /******/ (function(modules) { // webpackBootstrap
"use strict";
var pdfjsVersion = '2.0.815';
var pdfjsBuild = 'd6927376';
var pdfjsVersion = '2.0.841';
var pdfjsBuild = 'bc5111d1';
var pdfjsCoreWorker = __w_pdfjs_require__(1);
exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@ -327,7 +327,7 @@ var WorkerMessageHandler = {
var cancelXHRs = null;
var WorkerTasks = [];
let apiVersion = docParams.apiVersion;
let workerVersion = '2.0.815';
let workerVersion = '2.0.841';
if (apiVersion !== workerVersion) {
throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`);
}
@ -22285,7 +22285,7 @@ exports.CMapFactory = CMapFactory;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getFontType = exports.ProblematicCharRanges = exports.IdentityToUnicodeMap = exports.ToUnicodeMap = exports.FontFlags = exports.Font = exports.ErrorFont = exports.PRIVATE_USE_OFFSET_END = exports.PRIVATE_USE_OFFSET_START = exports.SEAC_ANALYSIS_ENABLED = undefined;
exports.getFontType = exports.IdentityToUnicodeMap = exports.ToUnicodeMap = exports.FontFlags = exports.Font = exports.ErrorFont = exports.SEAC_ANALYSIS_ENABLED = undefined;
var _util = __w_pdfjs_require__(2);
@ -22307,11 +22307,9 @@ var _stream = __w_pdfjs_require__(14);
var _type1_parser = __w_pdfjs_require__(38);
var PRIVATE_USE_OFFSET_START = 0xE000;
var PRIVATE_USE_OFFSET_END = 0xF8FF;
var SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = false;
const PRIVATE_USE_AREAS = [[0xE000, 0xF8FF], [0x100000, 0x10FFFD]];
var PDF_GLYPH_SPACE_UNITS = 1000;
var SEAC_ANALYSIS_ENABLED = false;
var SEAC_ANALYSIS_ENABLED = true;
var FontFlags = {
FixedPitch: 1,
Serif: 2,
@ -22590,7 +22588,6 @@ var OpenTypeFileBuilder = function OpenTypeFileBuilderClosure() {
};
return OpenTypeFileBuilder;
}();
var ProblematicCharRanges = new Int32Array([0x0000, 0x0020, 0x007F, 0x00A1, 0x00AD, 0x00AE, 0x0600, 0x0780, 0x08A0, 0x10A0, 0x1780, 0x1800, 0x1C00, 0x1C50, 0x2000, 0x2010, 0x2011, 0x2012, 0x2028, 0x2030, 0x205F, 0x2070, 0x25CC, 0x25CD, 0x3000, 0x3001, 0x3164, 0x3165, 0xAA60, 0xAA80, 0xD800, 0xE000, 0xFFF0, 0x10000]);
var Font = function FontClosure() {
function Font(name, file, properties) {
var charCode;
@ -22794,58 +22791,33 @@ var Font = function FontClosure() {
}
return toFontChar;
}
function isProblematicUnicodeLocation(code) {
var i = 0,
j = ProblematicCharRanges.length - 1;
while (i < j) {
var c = i + j + 1 >> 1;
if (code < ProblematicCharRanges[c]) {
j = c - 1;
} else {
i = c;
}
}
return !(i & 1);
}
function adjustMapping(charCodeToGlyphId, properties, missingGlyphs) {
var toUnicode = properties.toUnicode;
var isSymbolic = !!(properties.flags & FontFlags.Symbolic);
var isIdentityUnicode = properties.toUnicode instanceof IdentityToUnicodeMap;
function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId) {
var newMap = Object.create(null);
var toFontChar = [];
var usedFontCharCodes = [];
var nextAvailableFontCharCode = PRIVATE_USE_OFFSET_START;
var privateUseAreaIndex = 0;
var nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0];
var privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];
for (var originalCharCode in charCodeToGlyphId) {
originalCharCode |= 0;
var glyphId = charCodeToGlyphId[originalCharCode];
if (missingGlyphs[glyphId]) {
if (!hasGlyph(glyphId)) {
continue;
}
var fontCharCode = originalCharCode;
var hasUnicodeValue = false;
if (!isIdentityUnicode && toUnicode.has(originalCharCode)) {
hasUnicodeValue = true;
var unicode = toUnicode.get(fontCharCode);
if (unicode.length === 1) {
fontCharCode = unicode.charCodeAt(0);
if (nextAvailableFontCharCode > privateUseOffetEnd) {
privateUseAreaIndex++;
if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) {
(0, _util.warn)('Ran out of space in font private use area.');
break;
}
nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0];
privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];
}
if (usedFontCharCodes[fontCharCode] !== undefined || isProblematicUnicodeLocation(fontCharCode) || isSymbolic && !hasUnicodeValue) {
do {
if (nextAvailableFontCharCode > PRIVATE_USE_OFFSET_END) {
(0, _util.warn)('Ran out of space in font private use area.');
break;
}
fontCharCode = nextAvailableFontCharCode++;
if (SKIP_PRIVATE_USE_RANGE_F000_TO_F01F && fontCharCode === 0xF000) {
fontCharCode = 0xF020;
nextAvailableFontCharCode = fontCharCode + 1;
}
} while (usedFontCharCodes[fontCharCode] !== undefined);
var fontCharCode = nextAvailableFontCharCode++;
if (glyphId === 0) {
glyphId = newGlyphZeroId;
}
newMap[fontCharCode] = glyphId;
toFontChar[originalCharCode] = fontCharCode;
usedFontCharCodes[fontCharCode] = true;
}
return {
toFontChar,
@ -23032,6 +23004,9 @@ var Font = function FontClosure() {
throw new _util.FormatError('Unicode ranges Bits > 123 are reserved for internal usage');
}
}
if (lastCharIndex > 0xFFFF) {
lastCharIndex = 0xFFFF;
}
} else {
firstCharIndex = 0;
lastCharIndex = 255;
@ -23585,13 +23560,12 @@ var Font = function FontClosure() {
data[offset + 1] = value >> 1 & 0xFF;
};
}
var numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs;
var locaData = loca.data;
var locaDataSize = itemSize * (1 + numGlyphs);
if (locaData.length !== locaDataSize) {
locaData = new Uint8Array(locaDataSize);
locaData.set(loca.data.subarray(0, locaDataSize));
loca.data = locaData;
}
var locaDataSize = itemSize * (1 + numGlyphsOut);
locaData = new Uint8Array(locaDataSize);
locaData.set(loca.data.subarray(0, locaDataSize));
loca.data = locaData;
var oldGlyfData = glyf.data;
var oldGlyfDataLength = oldGlyfData.length;
var newGlyfData = new Uint8Array(oldGlyfDataLength);
@ -23600,8 +23574,7 @@ var Font = function FontClosure() {
var missingGlyphs = Object.create(null);
itemEncode(locaData, 0, writeOffset);
var i, j;
var locaCount = dupFirstEntry ? numGlyphs - 1 : numGlyphs;
for (i = 0, j = itemSize; i < locaCount; i++, j += itemSize) {
for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) {
var endOffset = itemDecode(locaData, j);
if (endOffset === 0) {
endOffset = startOffset;
@ -23626,7 +23599,7 @@ var Font = function FontClosure() {
}
if (writeOffset === 0) {
var simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]);
for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) {
for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) {
itemEncode(locaData, j, simpleGlyph.length);
}
glyf.data = simpleGlyph;
@ -24045,7 +24018,14 @@ var Font = function FontClosure() {
}
font.pos = (font.start || 0) + tables['maxp'].offset;
var version = font.getInt32();
var numGlyphs = font.getUint16();
const numGlyphs = font.getUint16();
let numGlyphsOut = numGlyphs + 1;
let dupFirstEntry = true;
if (numGlyphsOut > 0xFFFF) {
dupFirstEntry = false;
numGlyphsOut = numGlyphs;
(0, _util.warn)('Not enough space in glyfs to duplicate first glyph.');
}
var maxFunctionDefs = 0;
var maxSizeOfInstructions = 0;
if (version >= 0x00010000 && tables['maxp'].length >= 22) {
@ -24060,20 +24040,15 @@ var Font = function FontClosure() {
font.pos += 4;
maxSizeOfInstructions = font.getUint16();
}
var dupFirstEntry = false;
if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\u0000') {
dupFirstEntry = true;
numGlyphs++;
tables['maxp'].data[4] = numGlyphs >> 8;
tables['maxp'].data[5] = numGlyphs & 255;
}
tables['maxp'].data[4] = numGlyphsOut >> 8;
tables['maxp'].data[5] = numGlyphsOut & 255;
var hintsValid = sanitizeTTPrograms(tables['fpgm'], tables['prep'], tables['cvt '], maxFunctionDefs);
if (!hintsValid) {
delete tables['fpgm'];
delete tables['prep'];
delete tables['cvt '];
}
sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphs);
sanitizeMetrics(font, tables['hhea'], tables['hmtx'], numGlyphsOut);
if (!tables['head']) {
throw new _util.FormatError('Required "head" table is not found');
}
@ -24105,11 +24080,12 @@ var Font = function FontClosure() {
this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm;
this.descent = metricsOverride.descent / metricsOverride.unitsPerEm;
if (tables['post']) {
var valid = readPostScriptTable(tables['post'], properties, numGlyphs);
if (!valid) {
tables['post'] = null;
}
readPostScriptTable(tables['post'], properties, numGlyphs);
}
tables['post'] = {
tag: 'post',
data: createPostTable(properties)
};
var charCodeToGlyphId = [],
charCode;
function hasGlyph(glyphId) {
@ -24132,9 +24108,6 @@ var Font = function FontClosure() {
charCodeToGlyphId[charCode] = glyphId;
}
});
if (dupFirstEntry && (isCidToGidMapEmpty || !charCodeToGlyphId[0])) {
charCodeToGlyphId[0] = numGlyphs - 1;
}
} else {
var cmapTable = readCmapTable(tables['cmap'], font, this.isSymbolicFont, properties.hasEncoding);
var cmapPlatformId = cmapTable.platformId;
@ -24202,11 +24175,15 @@ var Font = function FontClosure() {
if (charCodeToGlyphId.length === 0) {
charCodeToGlyphId[0] = 0;
}
var newMapping = adjustMapping(charCodeToGlyphId, properties, missingGlyphs);
let glyphZeroId = numGlyphsOut - 1;
if (!dupFirstEntry) {
glyphZeroId = 0;
}
var newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId);
this.toFontChar = newMapping.toFontChar;
tables['cmap'] = {
tag: 'cmap',
data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphs)
data: createCmapTable(newMapping.charCodeToGlyphId, numGlyphsOut)
};
if (!tables['OS/2'] || !validateOS2Table(tables['OS/2'])) {
tables['OS/2'] = {
@ -24214,17 +24191,12 @@ var Font = function FontClosure() {
data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride)
};
}
if (!tables['post']) {
tables['post'] = {
tag: 'post',
data: createPostTable(properties)
};
}
if (!isTrueType) {
try {
cffFile = new _stream.Stream(tables['CFF '].data);
var parser = new _cff_parser.CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED);
cff = parser.parse();
cff.duplicateFirstGlyph();
var compiler = new _cff_parser.CFFCompiler(cff);
tables['CFF '].data = compiler.compile();
} catch (e) {
@ -24251,8 +24223,12 @@ var Font = function FontClosure() {
if (properties.builtInEncoding) {
adjustToUnicode(properties, properties.builtInEncoding);
}
let glyphZeroId = 1;
if (font instanceof CFFFont) {
glyphZeroId = font.numGlyphs - 1;
}
var mapping = font.getGlyphMapping(properties);
var newMapping = adjustMapping(mapping, properties, Object.create(null));
var newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId);
this.toFontChar = newMapping.toFontChar;
var numGlyphs = font.numGlyphs;
function getCharCodes(charCodeToGlyphId, glyphId) {
@ -24403,11 +24379,11 @@ var Font = function FontClosure() {
var seac = this.seacMap[charcode];
fontCharCode = seac.baseFontCharCode;
accent = {
fontChar: String.fromCharCode(seac.accentFontCharCode),
fontChar: String.fromCodePoint(seac.accentFontCharCode),
offset: seac.accentOffset
};
}
var fontChar = String.fromCharCode(fontCharCode);
var fontChar = typeof fontCharCode === 'number' ? String.fromCodePoint(fontCharCode) : '';
var glyph = this.glyphCache[charcode];
if (!glyph || !glyph.matchesForCache(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont)) {
glyph = new Glyph(fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont);
@ -24669,6 +24645,16 @@ var Type1Font = function Type1FontClosure() {
}
return type1FontGlyphMapping(properties, builtInEncoding, glyphNames);
},
hasGlyphId: function Type1Font_hasGlyphID(id) {
if (id < 0 || id >= this.numGlyphs) {
return false;
}
if (id === 0) {
return true;
}
var glyph = this.charstrings[id - 1];
return glyph.charstring.length > 0;
},
getSeacs: function Type1Font_getSeacs(charstrings) {
var i, ii;
var seacMap = [];
@ -24746,12 +24732,7 @@ var Type1Font = function Type1FontClosure() {
var charStringsIndex = new _cff_parser.CFFIndex();
charStringsIndex.add([0x8B, 0x0E]);
for (i = 0; i < count; i++) {
var glyph = glyphs[i];
if (glyph.length === 0) {
charStringsIndex.add([0x8B, 0x0E]);
continue;
}
charStringsIndex.add(glyph);
charStringsIndex.add(glyphs[i]);
}
cff.charStrings = charStringsIndex;
var privateDict = new _cff_parser.CFFPrivateDict();
@ -24787,6 +24768,7 @@ var CFFFont = function CFFFontClosure() {
this.properties = properties;
var parser = new _cff_parser.CFFParser(file, properties, SEAC_ANALYSIS_ENABLED);
this.cff = parser.parse();
this.cff.duplicateFirstGlyph();
var compiler = new _cff_parser.CFFCompiler(this.cff);
this.seacs = this.cff.seacs;
try {
@ -24827,29 +24809,19 @@ var CFFFont = function CFFFontClosure() {
var encoding = cff.encoding ? cff.encoding.encoding : null;
charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets);
return charCodeToGlyphId;
},
hasGlyphId: function CFFFont_hasGlyphID(id) {
return this.cff.hasGlyphId(id);
}
};
return CFFFont;
}();
(function checkSeacSupport() {
if (typeof navigator !== 'undefined' && /Windows/.test(navigator.userAgent)) {
exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED = true;
}
})();
(function checkChromeWindows() {
if (typeof navigator !== 'undefined' && /Windows.*Chrome/.test(navigator.userAgent)) {
SKIP_PRIVATE_USE_RANGE_F000_TO_F01F = true;
}
})();
exports.SEAC_ANALYSIS_ENABLED = SEAC_ANALYSIS_ENABLED;
exports.PRIVATE_USE_OFFSET_START = PRIVATE_USE_OFFSET_START;
exports.PRIVATE_USE_OFFSET_END = PRIVATE_USE_OFFSET_END;
exports.ErrorFont = ErrorFont;
exports.Font = Font;
exports.FontFlags = FontFlags;
exports.ToUnicodeMap = ToUnicodeMap;
exports.IdentityToUnicodeMap = IdentityToUnicodeMap;
exports.ProblematicCharRanges = ProblematicCharRanges;
exports.getFontType = getFontType;
/***/ }),
@ -24862,7 +24834,7 @@ exports.getFontType = getFontType;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.CFFCompiler = exports.CFFPrivateDict = exports.CFFTopDict = exports.CFFCharset = exports.CFFIndex = exports.CFFStrings = exports.CFFHeader = exports.CFF = exports.CFFParser = exports.CFFStandardStrings = undefined;
exports.CFFFDSelect = exports.CFFCompiler = exports.CFFPrivateDict = exports.CFFTopDict = exports.CFFCharset = exports.CFFIndex = exports.CFFStrings = exports.CFFHeader = exports.CFF = exports.CFFParser = exports.CFFStandardStrings = undefined;
var _util = __w_pdfjs_require__(2);
@ -25626,20 +25598,16 @@ var CFFParser = function CFFParserClosure() {
return new CFFEncoding(predefined, format, encoding, raw);
},
parseFDSelect: function CFFParser_parseFDSelect(pos, length) {
var start = pos;
var bytes = this.bytes;
var format = bytes[pos++];
var fdSelect = [],
rawBytes;
var i,
invalidFirstGID = false;
var fdSelect = [];
var i;
switch (format) {
case 0:
for (i = 0; i < length; ++i) {
var id = bytes[pos++];
fdSelect.push(id);
}
rawBytes = bytes.subarray(start, pos);
break;
case 3:
var rangesCount = bytes[pos++] << 8 | bytes[pos++];
@ -25647,7 +25615,6 @@ var CFFParser = function CFFParserClosure() {
var first = bytes[pos++] << 8 | bytes[pos++];
if (i === 0 && first !== 0) {
(0, _util.warn)('parseFDSelect: The first range must have a first GID of 0' + ' -- trying to recover.');
invalidFirstGID = true;
first = 0;
}
var fdIndex = bytes[pos++];
@ -25657,10 +25624,6 @@ var CFFParser = function CFFParserClosure() {
}
}
pos += 2;
rawBytes = bytes.subarray(start, pos);
if (invalidFirstGID) {
rawBytes[3] = rawBytes[4] = 0;
}
break;
default:
throw new _util.FormatError(`parseFDSelect: Unknown format "${format}".`);
@ -25668,7 +25631,7 @@ var CFFParser = function CFFParserClosure() {
if (fdSelect.length !== length) {
throw new _util.FormatError('parseFDSelect: Invalid font data.');
}
return new CFFFDSelect(fdSelect, rawBytes);
return new CFFFDSelect(format, fdSelect);
}
};
return CFFParser;
@ -25687,6 +25650,26 @@ var CFF = function CFFClosure() {
this.fdSelect = null;
this.isCIDFont = false;
}
CFF.prototype = {
duplicateFirstGlyph: function CFF_duplicateFirstGlyph() {
if (this.charStrings.count >= 65535) {
(0, _util.warn)('Not enough space in charstrings to duplicate first glyph.');
return;
}
var glyphZero = this.charStrings.get(0);
this.charStrings.add(glyphZero);
if (this.isCIDFont) {
this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]);
}
},
hasGlyphId: function CFF_hasGlyphID(id) {
if (id < 0 || id >= this.charStrings.count) {
return false;
}
var glyph = this.charStrings.get(id);
return glyph.length > 0;
}
};
return CFF;
}();
var CFFHeader = function CFFHeaderClosure() {
@ -25873,9 +25856,9 @@ var CFFEncoding = function CFFEncodingClosure() {
return CFFEncoding;
}();
var CFFFDSelect = function CFFFDSelectClosure() {
function CFFFDSelect(fdSelect, raw) {
function CFFFDSelect(format, fdSelect) {
this.format = format;
this.fdSelect = fdSelect;
this.raw = raw;
}
CFFFDSelect.prototype = {
getFDIndex: function CFFFDSelect_get(glyphIndex) {
@ -25966,6 +25949,7 @@ var CFFCompiler = function CFFCompilerClosure() {
}
}
}
cff.topDict.setByName('charset', 0);
var compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont);
output.add(compiled.output);
var topDictTracker = compiled.trackers[0];
@ -25982,21 +25966,15 @@ var CFFCompiler = function CFFCompilerClosure() {
output.add(encoding);
}
}
if (cff.charset && cff.topDict.hasName('charset')) {
if (cff.charset.predefined) {
topDictTracker.setEntryLocation('charset', [cff.charset.format], output);
} else {
var charset = this.compileCharset(cff.charset);
topDictTracker.setEntryLocation('charset', [output.length], output);
output.add(charset);
}
}
var charset = this.compileCharset(cff.charset);
topDictTracker.setEntryLocation('charset', [output.length], output);
output.add(charset);
var charStrings = this.compileCharStrings(cff.charStrings);
topDictTracker.setEntryLocation('CharStrings', [output.length], output);
output.add(charStrings);
if (cff.isCIDFont) {
topDictTracker.setEntryLocation('FDSelect', [output.length], output);
var fdSelect = this.compileFDSelect(cff.fdSelect.raw);
var fdSelect = this.compileFDSelect(cff.fdSelect);
output.add(fdSelect);
compiled = this.compileTopDicts(cff.fdArray, output.length, true);
topDictTracker.setEntryLocation('FDArray', [output.length], output);
@ -26191,16 +26169,55 @@ var CFFCompiler = function CFFCompilerClosure() {
this.out.writeByteArray(this.compileIndex(globalSubrIndex));
},
compileCharStrings: function CFFCompiler_compileCharStrings(charStrings) {
return this.compileIndex(charStrings);
var charStringsIndex = new CFFIndex();
for (var i = 0; i < charStrings.count; i++) {
var glyph = charStrings.get(i);
if (glyph.length === 0) {
charStringsIndex.add(new Uint8Array([0x8B, 0x0E]));
continue;
}
charStringsIndex.add(glyph);
}
return this.compileIndex(charStringsIndex);
},
compileCharset: function CFFCompiler_compileCharset(charset) {
return this.compileTypedArray(charset.raw);
let length = 1 + (this.cff.charStrings.count - 1) * 2;
let out = new Uint8Array(length);
return this.compileTypedArray(out);
},
compileEncoding: function CFFCompiler_compileEncoding(encoding) {
return this.compileTypedArray(encoding.raw);
},
compileFDSelect: function CFFCompiler_compileFDSelect(fdSelect) {
return this.compileTypedArray(fdSelect);
let format = fdSelect.format;
let out, i;
switch (format) {
case 0:
out = new Uint8Array(1 + fdSelect.fdSelect.length);
out[0] = format;
for (i = 0; i < fdSelect.fdSelect.length; i++) {
out[i + 1] = fdSelect.fdSelect[i];
}
break;
case 3:
let start = 0;
let lastFD = fdSelect.fdSelect[0];
let ranges = [format, 0, 0, start >> 8 & 0xFF, start & 0xFF, lastFD];
for (i = 1; i < fdSelect.fdSelect.length; i++) {
let currentFD = fdSelect.fdSelect[i];
if (currentFD !== lastFD) {
ranges.push(i >> 8 & 0xFF, i & 0xFF, currentFD);
lastFD = currentFD;
}
}
let numRanges = (ranges.length - 3) / 3;
ranges[1] = numRanges >> 8 & 0xFF;
ranges[2] = numRanges & 0xFF;
ranges.push(i >> 8 & 0xFF, i & 0xFF);
out = new Uint8Array(ranges);
break;
}
return this.compileTypedArray(out);
},
compileTypedArray: function CFFCompiler_compileTypedArray(data) {
var out = [];
@ -26271,6 +26288,7 @@ exports.CFFCharset = CFFCharset;
exports.CFFTopDict = CFFTopDict;
exports.CFFPrivateDict = CFFPrivateDict;
exports.CFFCompiler = CFFCompiler;
exports.CFFFDSelect = CFFFDSelect;
/***/ }),
/* 32 */
@ -33703,7 +33721,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
return glyphs;
}
function lookupCmap(ranges, unicode) {
var code = unicode.charCodeAt(0),
var code = unicode.codePointAt(0),
gid = 0;
var l = 0,
r = ranges.length - 1;

Просмотреть файл

@ -82,11 +82,15 @@ See https://github.com/adobe-type-tools/cmap-resources
</div>
</div>
<div id="findbarOptionsContainer">
<div id="findbarOptionsOneContainer">
<input type="checkbox" id="findHighlightAll" class="toolbarField" tabindex="94">
<label for="findHighlightAll" class="toolbarLabel" data-l10n-id="find_highlight">Highlight all</label>
<input type="checkbox" id="findMatchCase" class="toolbarField" tabindex="95">
<label for="findMatchCase" class="toolbarLabel" data-l10n-id="find_match_case_label">Match case</label>
</div>
<div id="findbarOptionsTwoContainer">
<input type="checkbox" id="findEntireWord" class="toolbarField" tabindex="96">
<label for="findEntireWord" class="toolbarLabel" data-l10n-id="find_entire_word_label">Whole words</label>
<span id="findResultsCount" class="toolbarLabel hidden"></span>
</div>

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -20,7 +20,7 @@ origin:
# Human-readable identifier for this version/release
# Generally "version NNN", "tag SSS", "bookmark SSS"
release: version 2.0.815
release: version 2.0.841
# The package's license, where possible using the mnemonic from
# https://spdx.org/licenses/

Просмотреть файл

@ -165,8 +165,16 @@ find_next.title=Find the next occurrence of the phrase
find_next_label=Next
find_highlight=Highlight all
find_match_case_label=Match case
find_entire_word_label=Whole words
find_reached_top=Reached top of document, continued from bottom
find_reached_bottom=Reached end of document, continued from top
# LOCALIZATION NOTE (find_matches_count): "{{current}}" and "{{total}}" will be
# replaced by a number representing the index of the currently active find result,
# respectively a number representing the total number of matches in the document.
find_matches_count={{current}} of {{total}} matches
# LOCALIZATION NOTE (find_matches_count_limit): "{{limit}}" will be replaced by
# a numerical value.
find_matches_count_limit=More than {{limit}} matches
find_not_found=Phrase not found
# Error panel labels