mhsf-dev/apps/www/src/app/api/og/fonts/index.ts

17 lines
531 B
TypeScript
Raw Normal View History

2025-03-08 15:21:26 -06:00
// For Edge runtime, we need to use fetch instead of fs
export async function loadFonts() {
const interRegularFontP = fetch(
new URL("./Inter-Regular.ttf", import.meta.url),
).then((res) => res.arrayBuffer());
const interMediumFontP = fetch(
new URL("./Inter-Medium.ttf", import.meta.url),
).then((res) => res.arrayBuffer());
const interBoldFontP = fetch(
new URL("./Inter-Bold.ttf", import.meta.url),
).then((res) => res.arrayBuffer());
return Promise.all([interRegularFontP, interMediumFontP, interBoldFontP]);
}