single-file-core 1.5.63 → 1.5.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -336,12 +336,15 @@
|
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
if (globalThis.FontFace) {
|
|
339
|
-
const
|
|
340
|
-
globalThis.FontFace = function () {
|
|
341
|
-
|
|
342
|
-
|
|
339
|
+
const origFontFace = globalThis.FontFace;
|
|
340
|
+
globalThis.FontFace = function FontFace(family, source, ...args) {
|
|
341
|
+
if (!new.target) {
|
|
342
|
+
return origFontFace();
|
|
343
|
+
}
|
|
344
|
+
getDetailObject(family, source, ...args).then(detail => document.dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail })));
|
|
345
|
+
return new FontFace(family, source, ...args);
|
|
343
346
|
};
|
|
344
|
-
globalThis.FontFace.prototype =
|
|
347
|
+
globalThis.FontFace.prototype = origFontFace.prototype;
|
|
345
348
|
globalThis.FontFace.toString = function () { return "function FontFace() { [native code] }"; };
|
|
346
349
|
const deleteFont = document.fonts.delete;
|
|
347
350
|
document.fonts.delete = function (fontFace) {
|