mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
Swap all files to new font system
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { createCanvas, loadImage, registerFont } = require('canvas');
|
||||
const { createCanvas, loadImage } = require('canvas');
|
||||
const path = require('path');
|
||||
const { wrapText } = require('../../util/Canvas');
|
||||
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Spongeboytt1.ttf'), { family: 'Spongeboytt1' });
|
||||
|
||||
module.exports = class SpongebobTimeCardCommand extends Command {
|
||||
constructor(client) {
|
||||
@@ -58,7 +57,7 @@ module.exports = class SpongebobTimeCardCommand extends Command {
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'top';
|
||||
ctx.font = '115px Spongeboytt1';
|
||||
ctx.font = this.client.fonts.get('Spongeboytt1.ttf').toCanvasString(115);
|
||||
const lines = await wrapText(ctx, text.toUpperCase(), 1800);
|
||||
const topMost = (canvas.height / 2) - (((115 * lines.length) / 2) + ((60 * (lines.length - 1)) / 2));
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user