From 2966171a2b37349bbe2ecf097e9a7557dab049cb Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Mon, 24 Feb 2025 15:58:25 +0100 Subject: [PATCH] Fix the `assert` in `FontLoader.prototype.loadSystemFont` Currently this `assert` isn't actually doing what it's supposed to, since the `FontLoader`-class doesn't have a `disableFontFace`-field. The `FontFaceObject`-class on the other hand has such a field, hence we update the method-signature to be able to check the intended thing. --- src/display/font_loader.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/display/font_loader.js b/src/display/font_loader.js index 06efa39e2..069fec119 100644 --- a/src/display/font_loader.js +++ b/src/display/font_loader.js @@ -80,12 +80,16 @@ class FontLoader { } } - async loadSystemFont({ systemFontInfo: info, _inspectFont }) { + async loadSystemFont({ + systemFontInfo: info, + disableFontFace, + _inspectFont, + }) { if (!info || this.#systemFonts.has(info.loadedName)) { return; } assert( - !this.disableFontFace, + !disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set." );