wee ooo wee oo

This commit is contained in:
TrèsAbhi committed 2024-03-09 23:04:09 -06:00
1 parent 64f1de37ad
commit 2610697d86
1 file changed
+7 -4
+7 -4
View File
@@ -3,17 +3,17 @@ import satori from 'satori';
const fonts = [
{
data: readFileSync(require('./Roboto.ttf')),
file: require('./Roboto.ttf') as string,
weight: 400 as const,
name: 'Roboto',
},
{
data: readFileSync(require('./Roboto-Bold.ttf')),
file: require('./Roboto-Bold.ttf') as string,
weight: 700 as const,
name: 'Roboto-Bold',
},
{
data: readFileSync(require('./Roboto-Black.ttf')),
file: require('./Roboto-Black.ttf') as string,
weight: 900 as const,
name: 'Roboto-Black',
},
@@ -22,6 +22,9 @@ const fonts = [
export default async function jsxToSvg(jsx: JSX.Element) {
return await satori(jsx, {
width: 480,
fonts,
fonts: fonts.map(({ file, ...font }) => ({
data: readFileSync(`${__dirname}/${file}`),
...font,
})),
});
}