Merge pull request #22059 from Snuffleupagus/FontInfo-rm-extra

Stop passing `extra` properties to the `FontInfo` class
This commit is contained in:
Tim van der Meij
2026-10-03 12:51:53 +02:00
committed by GitHub
3 changed files with 4 additions and 7 deletions
+1 -1
View File
@@ -2787,7 +2787,7 @@ class WorkerTransport {
break;
}
const fontData = new FontInfo(exportedData);
const fontData = new FontInfo(exportedData.buffer);
const inspectFont =
this._params.pdfBug && globalThis.FontInspector?.enabled
? (font, url) => globalThis.FontInspector.fontAdded(font, url)
+1 -4
View File
@@ -110,12 +110,9 @@ class FontInfo {
#view;
constructor({ buffer, extra }) {
constructor(buffer) {
this.#buffer = buffer;
this.#view = new DataView(buffer);
if (extra) {
Object.assign(this, extra);
}
}
#readBoolean(index) {
+2 -2
View File
@@ -129,7 +129,7 @@ describe("obj_bin_transform", function () {
sizeEstimate += 4 + fontInfo.data.length;
const buffer = compileFontInfo(fontInfo);
expect(buffer.byteLength).toEqual(sizeEstimate);
const deserialized = new FontInfo({ buffer });
const deserialized = new FontInfo(buffer);
expect(deserialized.black).toBeTrue();
expect(deserialized.bold).toBeTrue();
expect(deserialized.disableFontFace).toBeTrue();
@@ -160,7 +160,7 @@ describe("obj_bin_transform", function () {
cssFontInfo,
systemFontInfo,
});
const deserialized = new FontInfo({ buffer });
const deserialized = new FontInfo(buffer);
expect(deserialized.cssFontInfo.fontWeight).toEqual("not a number");
expect(deserialized.systemFontInfo.src).toEqual("source");
});