fix(og): make sure to replace space in fonts with +

Signed-off-by: Aaron Pham <contact@aarnphm.xyz>
This commit is contained in:
Aaron Pham 2025-01-17 07:52:03 -05:00
parent 7e828252bb
commit 3e9be39851
No known key found for this signature in database
GPG Key ID: 18974753009D2BFA

View File

@ -36,7 +36,7 @@ async function fetchTtf(fontName: string, weight: FontWeight): Promise<ArrayBuff
try { try {
// Get css file from google fonts // Get css file from google fonts
const cssResponse = await fetch( const cssResponse = await fetch(
`https://fonts.googleapis.com/css2?family=${fontName}:wght@${weight}`, `https://fonts.googleapis.com/css2?family=${fontName.replace(" ", "+")}:wght@${weight}`,
) )
const css = await cssResponse.text() const css = await cssResponse.text()