From e17323c15c6662b21c6784ef5ebd4b6e33d3e8b9 Mon Sep 17 00:00:00 2001 From: iCrawl Date: Tue, 11 Oct 2022 03:51:46 +0200 Subject: [PATCH] fix: only include used fonts --- apps/website/src/pages/api/og.tsx | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/website/src/pages/api/og.tsx b/apps/website/src/pages/api/og.tsx index a87a55b5d..f210ad02e 100644 --- a/apps/website/src/pages/api/og.tsx +++ b/apps/website/src/pages/api/og.tsx @@ -2,11 +2,11 @@ import { ImageResponse } from '@vercel/og'; const fonts = Promise.all([ - fetch(new URL('../../assets/fonts/Inter-Light.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), - fetch(new URL('../../assets/fonts/Inter-Regular.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), - fetch(new URL('../../assets/fonts/Inter-Medium.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), - fetch(new URL('../../assets/fonts/Inter-SemiBold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), - fetch(new URL('../../assets/fonts/Inter-Bold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + // fetch(new URL('../../assets/fonts/Inter-Light.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + // fetch(new URL('../../assets/fonts/Inter-Regular.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + // fetch(new URL('../../assets/fonts/Inter-Medium.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + // fetch(new URL('../../assets/fonts/Inter-SemiBold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), + // fetch(new URL('../../assets/fonts/Inter-Bold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), fetch(new URL('../../assets/fonts/Inter-Black.ttf', import.meta.url)).then(async (res) => res.arrayBuffer()), ]); @@ -40,12 +40,12 @@ export default async function handler() { width: 1_200, height: 630, fonts: [ - { name: 'Inter', data: fontData[0], weight: 300, style: 'normal' }, - { name: 'Inter', data: fontData[1], weight: 400, style: 'normal' }, - { name: 'Inter', data: fontData[2], weight: 500, style: 'normal' }, - { name: 'Inter', data: fontData[3], weight: 600, style: 'normal' }, - { name: 'Inter', data: fontData[4], weight: 700, style: 'normal' }, - { name: 'Inter', data: fontData[5], weight: 900, style: 'normal' }, + // { name: 'Inter', data: fontData[0], weight: 300, style: 'normal' }, + // { name: 'Inter', data: fontData[1], weight: 400, style: 'normal' }, + // { name: 'Inter', data: fontData[2], weight: 500, style: 'normal' }, + // { name: 'Inter', data: fontData[3], weight: 600, style: 'normal' }, + // { name: 'Inter', data: fontData[4], weight: 700, style: 'normal' }, + { name: 'Inter', data: fontData[0], weight: 900, style: 'normal' }, ], }, );