This commit is contained in:
Dragon Fire
2021-02-20 11:30:35 -05:00
parent 1202e2c4e6
commit 598eb89435
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = class FontCommand extends Command {
const canvasPre = createCanvas(1, 1);
const ctxPre = canvasPre.getContext('2d');
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(75);
const len = ctx.measureText(text);
const len = ctxPre.measureText(text);
const lines = wrapText(ctxPre, text, 450);
const canvas = createCanvas(Math.min(len, 500), 50 + (75 * lines.length));
const ctx = canvas.getContext('2d');