founders card

This commit is contained in:
2026-09-14 13:23:14 +00:00
parent c5084170b8
commit 64759ce17d
57 changed files with 5013 additions and 188 deletions
+24
View File
@@ -0,0 +1,24 @@
import path from "node:path";
import { CUSTOM_FONT_FAMILY } from "@/lib/card-gen/id-config";
import { PRESET_FONTS } from "@/lib/card-gen/fonts";
export function fontsDir(): string {
return path.join(process.cwd(), "public", "fonts");
}
export function fontEntriesForFamily(
family: string,
customFontPath?: string | null,
): { path: string; family: string }[] {
if (family === CUSTOM_FONT_FAMILY) {
if (!customFontPath) return [];
return [{ path: customFontPath, family: CUSTOM_FONT_FAMILY }];
}
const preset = PRESET_FONTS.find((f) => f.family === family);
if (!preset) return [];
const dir = fontsDir();
return [
{ path: path.join(dir, preset.regularFile), family: preset.family },
{ path: path.join(dir, preset.boldFile), family: preset.family },
];
}