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

14 lines
400 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() {
2025-03-09 20:17:47 -05:00
const interRegularFontP = fetch(
new URL("./Inter-Regular.ttf", import.meta.url)
).then((res) => res.arrayBuffer());
2025-03-08 15:21:26 -06:00
2025-03-09 20:17:47 -05:00
const interBoldFontP = fetch(
new URL("./Inter-Bold.ttf", import.meta.url)
).then((res) => res.arrayBuffer());
2025-03-08 15:21:26 -06:00
return Promise.all([interRegularFontP, interBoldFontP]);
2025-03-08 15:21:26 -06:00
}