This commit is contained in:
Dragon Fire
2021-02-20 11:46:16 -05:00
parent 2189c1b1ac
commit a9d22f06d9
+2 -2
View File
@@ -39,8 +39,8 @@ module.exports = class FontCommand extends Command {
const ctxPre = canvasPre.getContext('2d');
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(75);
const len = ctxPre.measureText(text);
const lines = await wrapText(ctxPre, text, 450);
const canvas = createCanvas(Math.min(len.width + 50, 500), 50 + (75 * lines.length));
const lines = await wrapText(ctxPre, text, 950);
const canvas = createCanvas(Math.min(len.width + 50, 1000), 50 + (75 * lines.length) + (5 * lines.length));
const ctx = canvas.getContext('2d');
ctx.font = this.client.fonts.get(font.filename).toCanvasString(75);
ctx.textBaseline = 'top';