(file: string)
| 20 | * ``` |
| 21 | */ |
| 22 | export async function loadFont(file: string) { |
| 23 | let fileOrBuffer: string | Buffer = file; |
| 24 | |
| 25 | if (typeof window === "undefined" && !isWebWorker) { |
| 26 | const { existsSync, promises: fs } = await import("fs"); |
| 27 | |
| 28 | if (existsSync(file)) { |
| 29 | fileOrBuffer = await fs.readFile(file); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | const data = await loadBitmapFontData(fileOrBuffer); |
| 34 | return processBitmapFont(file, data); |
| 35 | } |
searching dependent graphs…