mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-14 15:57:42 +02:00
Fix
This commit is contained in:
@@ -43,13 +43,8 @@ module.exports = class RawCommand extends Command {
|
|||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
ctx.textAlign = 'center';
|
ctx.textAlign = 'center';
|
||||||
ctx.textBaseline = 'top';
|
ctx.textBaseline = 'top';
|
||||||
ctx.font = this.client.fonts.get('wildwordsroman.ttf').toCanvasString(24);
|
ctx.font = this.client.fonts.get('wildwordsroman.ttf').toCanvasString(23);
|
||||||
let fontSize = 24;
|
ctx.fillText(text, 520, 145, 165);
|
||||||
while (ctx.measureText(text).width > 168) {
|
|
||||||
fontSize--;
|
|
||||||
ctx.font = this.client.fonts.get('wildwordsroman.ttf').toCanvasString(fontSize);
|
|
||||||
}
|
|
||||||
ctx.fillText(text, 520, 142);
|
|
||||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'raw.png' }] });
|
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'raw.png' }] });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user