mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Merge pull request #18066 from Snuffleupagus/rm-FontFaceObject-ignoreErrors
Remove the `ignoreErrors` option from the `FontFaceObject` class
This commit is contained in:
commit
761abc7cc3
2 changed files with 5 additions and 14 deletions
|
@ -383,7 +383,6 @@ function getDocument(src) {
|
|||
},
|
||||
};
|
||||
const transportParams = {
|
||||
ignoreErrors,
|
||||
disableFontFace,
|
||||
fontExtraProperties,
|
||||
enableXfa,
|
||||
|
@ -2756,7 +2755,7 @@ class WorkerTransport {
|
|||
|
||||
switch (type) {
|
||||
case "Font":
|
||||
const params = this._params;
|
||||
const { disableFontFace, fontExtraProperties, pdfBug } = this._params;
|
||||
|
||||
if ("error" in exportedData) {
|
||||
const exportedError = exportedData.error;
|
||||
|
@ -2766,12 +2765,11 @@ class WorkerTransport {
|
|||
}
|
||||
|
||||
const inspectFont =
|
||||
params.pdfBug && globalThis.FontInspector?.enabled
|
||||
pdfBug && globalThis.FontInspector?.enabled
|
||||
? (font, url) => globalThis.FontInspector.fontAdded(font, url)
|
||||
: null;
|
||||
const font = new FontFaceObject(exportedData, {
|
||||
disableFontFace: params.disableFontFace,
|
||||
ignoreErrors: params.ignoreErrors,
|
||||
disableFontFace,
|
||||
inspectFont,
|
||||
});
|
||||
|
||||
|
@ -2779,7 +2777,7 @@ class WorkerTransport {
|
|||
.bind(font)
|
||||
.catch(() => messageHandler.sendWithPromise("FontFallback", { id }))
|
||||
.finally(() => {
|
||||
if (!params.fontExtraProperties && font.data) {
|
||||
if (!fontExtraProperties && font.data) {
|
||||
// Immediately release the `font.data` property once the font
|
||||
// has been attached to the DOM, since it's no longer needed,
|
||||
// rather than waiting for a `PDFDocumentProxy.cleanup` call.
|
||||
|
|
|
@ -360,17 +360,13 @@ class FontLoader {
|
|||
}
|
||||
|
||||
class FontFaceObject {
|
||||
constructor(
|
||||
translatedData,
|
||||
{ disableFontFace = false, ignoreErrors = false, inspectFont = null }
|
||||
) {
|
||||
constructor(translatedData, { disableFontFace = false, inspectFont = null }) {
|
||||
this.compiledGlyphs = Object.create(null);
|
||||
// importing translated data
|
||||
for (const i in translatedData) {
|
||||
this[i] = translatedData[i];
|
||||
}
|
||||
this.disableFontFace = disableFontFace === true;
|
||||
this.ignoreErrors = ignoreErrors === true;
|
||||
this._inspectFont = inspectFont;
|
||||
}
|
||||
|
||||
|
@ -430,9 +426,6 @@ class FontFaceObject {
|
|||
try {
|
||||
cmds = objs.get(this.loadedName + "_path_" + character);
|
||||
} catch (ex) {
|
||||
if (!this.ignoreErrors) {
|
||||
throw ex;
|
||||
}
|
||||
warn(`getPathGenerator - ignoring character: "${ex}".`);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue