mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 01:35:43 +02:00
Slightly reduce the size of the FontInspector
-integration in the API
Given that this functionality only applies in the viewer, when `PDFBug` is being enabled and used, it can't hurt to slightly reduce the size of this code.
This commit is contained in:
parent
184f5701e9
commit
378caa7203
2 changed files with 9 additions and 13 deletions
|
@ -2762,19 +2762,15 @@ class WorkerTransport {
|
|||
break;
|
||||
}
|
||||
|
||||
let fontRegistry = null;
|
||||
if (params.pdfBug && globalThis.FontInspector?.enabled) {
|
||||
fontRegistry = {
|
||||
registerFont(font, url) {
|
||||
globalThis.FontInspector.fontAdded(font, url);
|
||||
},
|
||||
};
|
||||
}
|
||||
const inspectFont =
|
||||
params.pdfBug && globalThis.FontInspector?.enabled
|
||||
? (font, url) => globalThis.FontInspector.fontAdded(font, url)
|
||||
: null;
|
||||
const font = new FontFaceObject(exportedData, {
|
||||
isEvalSupported: params.isEvalSupported,
|
||||
disableFontFace: params.disableFontFace,
|
||||
ignoreErrors: params.ignoreErrors,
|
||||
fontRegistry,
|
||||
inspectFont,
|
||||
});
|
||||
|
||||
this.fontLoader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue