This commit is contained in:
Ashley Graves 2024-10-12 14:01:11 +02:00
parent c49108639c
commit eece64d527

View file

@ -83,7 +83,7 @@ module.exports = {
ctx.drawImage(fade, cardHeight - 400, 0, 400, cardHeight); ctx.drawImage(fade, cardHeight - 400, 0, 400, cardHeight);
ctx.fillStyle = "#fff"; ctx.fillStyle = "#fff";
ctx.font = "italic 20px Georgia"; ctx.font = "italic 20px Twitter Color Emoji";
const quoteWidth = cardWidth / 2 - 50; const quoteWidth = cardWidth / 2 - 50;
const quoteX = ((cardWidth - cardHeight)); const quoteX = ((cardWidth - cardHeight));
const quoteY = cardHeight / 2 - 10; const quoteY = cardHeight / 2 - 10;
@ -91,7 +91,7 @@ module.exports = {
const wrappedTextHeight = lines.length * 25; const wrappedTextHeight = lines.length * 25;
ctx.font = "bold 16px Georgia"; ctx.font = "bold 16px Twitter Color Emoji";
const authorNameX = (cardHeight * 1.5) - (ctx.measureText(`- ${name}`).width / 2) - 30; const authorNameX = (cardHeight * 1.5) - (ctx.measureText(`- ${name}`).width / 2) - 30;
const authorNameY = quoteY + wrappedTextHeight + 30; const authorNameY = quoteY + wrappedTextHeight + 30;
@ -101,4 +101,4 @@ module.exports = {
return await canvasToBuffer(canvas); return await canvasToBuffer(canvas);
} }
} }