Skip to content

How to get custom font's to work with OG images #1567

Answered by ayoubkhial
chopfitzroy asked this question in Help
Discussion options

You must be logged in to vote

Hey there,
I had the same problem; I solved it by loading the fonts in Node.js runtime.

const font = fs.promises.readFile(path.join(fileURLToPath(import.meta.url), '../../../../../public/fonts/OpenSans-SemiBold.ttf'));

Read more on Vercel documentation.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@chopfitzroy
Comment options

@kaartik2611
Comment options

Answer selected by chopfitzroy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
OG Images Open Graph Image Generation
4 participants