This commit is contained in:
Dragon Fire
2024-05-03 00:49:51 -04:00
parent dfa215b296
commit f36521e805
+1 -1
View File
@@ -38,7 +38,7 @@ module.exports = class FontCommand extends Command {
ctxPre.font = this.client.fonts.get(font.filename).toCanvasString(50);
const len = ctxPre.measureText(text);
const lines = wrapText(ctxPre, text, 950);
const height = len.actualBoundingBoxAscent + len.actualBoundingBoxDescent;
const height = len.emHeightAscent + len.emHeightDescent;
const canvas = createCanvas(Math.min(len.width + 50, 1000), 50 + height);
const ctx = canvas.getContext('2d');
ctx.font = this.client.fonts.get(font.filename).toCanvasString(50);