Stop importing second font weight in OG images

This commit is contained in:
Sam Becker 2025-03-13 00:39:03 -05:00
parent f4447b3474
commit 3b39a1b62e

View File

@ -3,30 +3,18 @@ import path from 'path';
import { cwd } from 'process';
const FONT_IBM_PLEX_MONO_FAMILY = 'IBMPlexMono';
const FONT_IBM_PLEX_MONO_PATH = '/public/fonts/IBMPlexMono-Medium.ttf';
const FONT_IBM_PLEX_MONO_PATH_REGULAR = '/public/fonts/IBMPlexMono-Regular.ttf';
const FONT_IBM_PLEX_MONO_PATH_MEDIUM = '/public/fonts/IBMPlexMono-Medium.ttf';
const getFontData = async () =>
fs.readFileSync(path.join(cwd(), FONT_IBM_PLEX_MONO_PATH));
const getFontData = async (fontPath: string) =>
fs.readFileSync(path.join(cwd(), fontPath));
export const getIBMPlexMono = async () => {
const regular = await getFontData(FONT_IBM_PLEX_MONO_PATH_REGULAR);
const medium = await getFontData(FONT_IBM_PLEX_MONO_PATH_MEDIUM);
return {
export const getIBMPlexMono = () => getFontData()
.then(data => ({
fontFamily: FONT_IBM_PLEX_MONO_FAMILY,
fonts: [{
name: FONT_IBM_PLEX_MONO_FAMILY,
data: regular,
weight: 400,
style: 'normal',
} as const, {
name: FONT_IBM_PLEX_MONO_FAMILY,
data: medium,
data,
weight: 500,
style: 'normal',
} as const,
],
};
};
} as const],
}));