|
|
@@ -22,6 +22,7 @@
|
|
|
|
|
|
this.fontFaceProxy = this.fontFaceProxy || (() => {
|
|
|
|
|
|
+ const NEW_FONT_FACE_EVENT = "single-file-new-font-face";
|
|
|
const fontFaces = [];
|
|
|
|
|
|
if (document instanceof HTMLDocument) {
|
|
|
@@ -29,7 +30,7 @@ this.fontFaceProxy = this.fontFaceProxy || (() => {
|
|
|
scriptElement.textContent = `(${hook.toString()})()`;
|
|
|
document.documentElement.appendChild(scriptElement);
|
|
|
scriptElement.remove();
|
|
|
- addEventListener("single-file-font-face", event => fontFaces.push(event.detail));
|
|
|
+ addEventListener(NEW_FONT_FACE_EVENT, event => fontFaces.push(event.detail));
|
|
|
}
|
|
|
|
|
|
return {
|
|
|
@@ -58,7 +59,7 @@ this.fontFaceProxy = this.fontFaceProxy || (() => {
|
|
|
if (descriptors) {
|
|
|
Object.keys(descriptors).forEach(descriptor => detail[FONT_STYLE_PROPERTIES[descriptor]] = descriptors[descriptor]);
|
|
|
}
|
|
|
- dispatchEvent(new CustomEvent("single-file-font-face", { detail }));
|
|
|
+ dispatchEvent(new CustomEvent(NEW_FONT_FACE_EVENT, { detail }));
|
|
|
return new FontFace(...argumentsList);
|
|
|
}
|
|
|
}));
|