fix issues
This commit is contained in:
parent
835efb31b9
commit
6a406db60a
23 changed files with 295 additions and 118 deletions
|
@ -2,38 +2,6 @@
|
|||
//
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
type CSSOMString = string;
|
||||
type FontFaceLoadStatus = "unloaded" | "loading" | "loaded" | "error";
|
||||
type FontFaceSetStatus = "loading" | "loaded";
|
||||
|
||||
interface FontFace {
|
||||
family: CSSOMString;
|
||||
style: CSSOMString;
|
||||
weight: CSSOMString;
|
||||
stretch: CSSOMString;
|
||||
unicodeRange: CSSOMString;
|
||||
variant: CSSOMString;
|
||||
featureSettings: CSSOMString;
|
||||
variationSettings: CSSOMString;
|
||||
display: CSSOMString;
|
||||
readonly status: FontFaceLoadStatus;
|
||||
readonly loaded: Promise<FontFace>;
|
||||
load(): Promise<FontFace>;
|
||||
}
|
||||
|
||||
interface FontFaceSet {
|
||||
readonly status: FontFaceSetStatus;
|
||||
readonly ready: Promise<FontFaceSet>;
|
||||
check(font: string, text?: string): boolean;
|
||||
load(font: string, text?: string): Promise<FontFace[]>;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface Document {
|
||||
fonts: FontFaceSet;
|
||||
}
|
||||
}
|
||||
|
||||
const fonts = ["Lora", "Wood Stamp"];
|
||||
|
||||
export async function preloadFonts(): Promise<FontFace[][]> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue