Transfer to @napi-rs/canvas again (this time w/ line breaks)

This commit is contained in:
Dragon Fire
2024-05-03 10:21:28 -04:00
parent 0d04b94797
commit bed3847f60
174 changed files with 234 additions and 227 deletions
+3 -3
View File
@@ -1,6 +1,6 @@
const Command = require('../../framework/Command');
const { createCanvas } = require('canvas');
const { wrapText } = require('../../util/Canvas');
const { createCanvas } = require('@napi-rs/canvas');
const { wrapText, fillTextWithBreaks } = require('../../util/Canvas');
module.exports = class FontCommand extends Command {
constructor(client) {
@@ -46,7 +46,7 @@ module.exports = class FontCommand extends Command {
ctx.fillStyle = 'white';
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = 'black';
ctx.fillText(lines.join('\n'), 25, 25);
fillTextWithBreaks(ctx, lines.join('\n'), 25, 25);
return canvas.toBuffer();
}
};