mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 08:22:22 +02:00
registerFont
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { createCanvas, loadImage, parseFont } = require('canvas');
|
||||
const { createCanvas, loadImage, registerFont } = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const moment = require('moment');
|
||||
const path = require('path');
|
||||
@@ -42,7 +42,7 @@ module.exports = class CardCommand extends Command {
|
||||
if (cardID < 5000) rarity = 'C';
|
||||
else if (cardID < 8000) rarity = 'U';
|
||||
else rarity = 'R';
|
||||
parseFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' });
|
||||
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' });
|
||||
const canvas = createCanvas(390, 544);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'card.png'));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { createCanvas, loadImage, parseFont } = require('canvas');
|
||||
const { createCanvas, loadImage, registerFont } = require('canvas');
|
||||
const snekfetch = require('snekfetch');
|
||||
const path = require('path');
|
||||
|
||||
@@ -34,7 +34,7 @@ module.exports = class SteamCardCommand extends Command {
|
||||
size: 512
|
||||
});
|
||||
try {
|
||||
parseFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' });
|
||||
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Roboto.ttf'), { family: 'Roboto' });
|
||||
const canvas = createCanvas(494, 568);
|
||||
const ctx = canvas.getContext('2d');
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'steam-card.png'));
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "34.0.0",
|
||||
"version": "34.0.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Shard.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user