This commit is contained in:
2026-01-06 13:55:24 -03:00
parent 0368ba876f
commit 057619e2a7
2 changed files with 5 additions and 3 deletions

View File

@@ -186,8 +186,9 @@ export const GET: RequestHandler = async ({ params, fetch, request }) => {
} }
}; };
const fontPath = join(process.cwd(), 'src', 'lib', 'assets', 'fonts', 'Ubuntu-Regular.ttf'); const font = await fetch(`${new URL(request.url).origin}/fonts/Ubuntu-Regular.ttf`).then((r) =>
const fontData = readFileSync(fontPath); r.arrayBuffer()
);
const svg = await satori(element, { const svg = await satori(element, {
width: 600, width: 600,
@@ -195,7 +196,8 @@ export const GET: RequestHandler = async ({ params, fetch, request }) => {
fonts: [ fonts: [
{ {
name: 'Inter', name: 'Inter',
data: fontData,
data: font,
weight: 400, weight: 400,
style: 'normal' style: 'normal'
} }