This commit is contained in:
Dragon Fire
2020-06-04 09:54:40 -04:00
parent 64d335374e
commit cd42c17889
+2 -2
View File
@@ -53,12 +53,12 @@ module.exports = class EddFactsBookCommand extends Command {
ctx.rotate(15 * (Math.PI / 180));
ctx.font = '30px Noto';
let fontSize = 30;
while (ctx.measureText(fact).width > 549) {
while (ctx.measureText(fact).width > 458) {
fontSize -= 1;
ctx.font = `${fontSize}px Noto`;
}
const lines = await wrapText(ctx, fact, 183);
ctx.fillText(lines.join('\n'), 119, 316, 183);
ctx.fillText(lines.join('\n'), 119, 306, 183);
ctx.rotate(-15 * (Math.PI / 180));
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'edd-facts-book.png' }] });
}