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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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,