MCPcopy
hub / github.com/jimp-dev/jimp / loadFont

Function loadFont

plugins/plugin-print/src/load-font.ts:22–35  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

20 * ```
21 */
22export 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}

Callers 2

createTextImageFunction · 0.85
index.node.test.tsFile · 0.85

Calls 2

loadBitmapFontDataFunction · 0.85
processBitmapFontFunction · 0.85

Tested by 1

createTextImageFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…