fix: fonts not rendered on init if loadingdone not fired (#5923)

* fix: fonts not rendered on init if `loadingdone` not fired

* remove unnecessary check
This commit is contained in:
David Luzar
2022-11-23 21:15:32 +01:00
committed by GitHub
parent 52c96a6870
commit 1f117995d9
3 changed files with 113 additions and 23 deletions

2
src/global.d.ts vendored
View File

@@ -2,6 +2,8 @@
interface Document {
fonts?: {
ready?: Promise<void>;
check?: (font: string, text?: string) => boolean;
load?: (font: string, text?: string) => Promise<FontFace[]>;
addEventListener?(
type: "loading" | "loadingdone" | "loadingerror",
listener: (this: Document, ev: Event) => any,