switch to eta

This commit is contained in:
hazycora 2023-08-02 17:37:47 -05:00
parent c0faaf51ff
commit 578279a07d
No known key found for this signature in database
GPG key ID: 215AF1F81F86940E
7 changed files with 2784 additions and 1016 deletions

35
lib/render.js Normal file
View file

@ -0,0 +1,35 @@
import html2png from '@besties/html2png'
import fs from 'node:fs'
const figtreeRegular = fs.readFileSync('./assets/Figtree-Regular.woff')
const figtreeMedium = fs.readFileSync('./assets/Figtree-Medium.woff')
const figtreeExtraBold = fs.readFileSync('./assets/Figtree-ExtraBold.woff')
const css = fs.readFileSync('./assets/style.css', 'utf8')
const renderOptions = {
fonts: [
{
name: 'Figtree',
data: figtreeRegular,
weight: 400,
style: 'normal'
},
{
name: 'Figtree',
data: figtreeMedium,
weight: 500,
style: 'normal'
},
{
name: 'Figtree',
data: figtreeExtraBold,
weight: 800,
style: 'normal'
}
]
}
export default function (html) {
return html2png(html, css, renderOptions)
}