mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Transition to @napi-rs/canvas
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../framework/Command');
|
||||
const { createCanvas } = require('canvas');
|
||||
const { createCanvas } = require('@napi-rs/canvas');
|
||||
const { wrapText } = require('../../util/Canvas');
|
||||
|
||||
module.exports = class FontCommand extends Command {
|
||||
@@ -47,6 +47,6 @@ module.exports = class FontCommand extends Command {
|
||||
ctx.fillRect(0, 0, canvas.width, canvas.height);
|
||||
ctx.fillStyle = 'black';
|
||||
ctx.fillText(lines.join('\n'), 25, 25);
|
||||
return canvas.toBuffer();
|
||||
return canvas.toBuffer('image/png');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user