This commit is contained in:
2026-09-13 14:58:27 +05:30
parent 4f80c16043
commit 9c7a16b57c
24 changed files with 2467 additions and 80 deletions
+16
View File
@@ -0,0 +1,16 @@
import { GlobalFonts } from "@napi-rs/canvas";
import path from "node:path";
import { PRESET_FONTS } from "./fonts";
let registered = false;
export function registerPresetFonts(): void {
if (registered) return;
const dir = path.join(process.cwd(), "public", "fonts");
for (const font of PRESET_FONTS) {
GlobalFonts.registerFromPath(path.join(dir, font.regular), font.id);
GlobalFonts.registerFromPath(path.join(dir, font.bold), font.id);
}
registered = true;
}