Swap all files to new font system

This commit is contained in:
Dragon Fire
2021-02-20 10:41:45 -05:00
parent 1eb843f1b2
commit 96f5e73f6f
70 changed files with 220 additions and 387 deletions
+2 -3
View File
@@ -1,7 +1,6 @@
const Command = require('../../structures/Command');
const { createCanvas, loadImage, registerFont } = require('canvas');
const { createCanvas, loadImage } = require('canvas');
const path = require('path');
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'HWYGWDE.ttf'), { family: 'Highway Gothic' });
module.exports = class SpeedLimitCommand extends Command {
constructor(client) {
@@ -48,7 +47,7 @@ module.exports = class SpeedLimitCommand extends Command {
ctx.drawImage(base, 0, 0);
ctx.textBaseline = 'top';
ctx.textAlign = 'center';
ctx.font = '360px Highway Gothic';
ctx.font = this.client.fonts.get('HWYGWDE.ttf').toCanvasString(360);
ctx.fillStyle = 'black';
ctx.fillText(limit.toUpperCase(), 313, 356, 475);
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'speed-limit.png' }] });