You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
const satori = require("satori");
const React = require("react");
async function getFontData(fontUrl) {
// Make an HTTP GET request to the font URL
const response = await axios.get(fontUrl, { responseType: "arraybuffer" });
// Return the response data as a Buffer
return Buffer.from(response.data);
}
async function generateImage() {
const fontData = await getFontData("https://fonts.googleapis.com/css2?family=Roboto&display=swap");
const svg = await satori(<div style={{ color: "black" }}>hello, world</div>, {
width: 600,
height: 400,
fonts: [
{
name: "Roboto",
// Provide the font data as an ArrayBuffer
data: fontData,
weight: 400,
style: "normal",
},
],
});
}
generateImage();
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is the output
Anyone please help me fixing this issue
Beta Was this translation helpful? Give feedback.
All reactions