diff --git a/commands/image-edit/lisa-presentation.js b/commands/image-edit/lisa-presentation.js index 0a6b21ce..f6957a82 100644 --- a/commands/image-edit/lisa-presentation.js +++ b/commands/image-edit/lisa-presentation.js @@ -24,7 +24,7 @@ module.exports = class LisaPresentationCommand extends Command { key: 'text', prompt: 'What should the text of the presentation be?', type: 'string', - max: 280 + max: 500 } ] }); @@ -35,8 +35,13 @@ module.exports = class LisaPresentationCommand extends Command { const canvas = createCanvas(base.width, base.height); const ctx = canvas.getContext('2d'); ctx.drawImage(base, 0, 0); - ctx.font = '24px Noto'; ctx.textAlign = 'center'; + ctx.font = '40px Noto'; + let fontSize = 40; + while (ctx.measureText(text).width > 990) { + fontSize -= 1; + ctx.font = `${fontSize}px Noto`; + } const lines = await wrapText(ctx, text, 330); for (let i = 0; i < lines.length; i++) { const textHeight = 95 + (i * 24) + (i * 10);