mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 21:40:49 +02:00
Fix gru plan font size
This commit is contained in:
@@ -5,7 +5,7 @@ const { wrapText } = require('../../util/Canvas');
|
|||||||
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Regular.ttf'), { family: 'Noto' });
|
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Regular.ttf'), { family: 'Noto' });
|
||||||
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-CJK.otf'), { family: 'Noto' });
|
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-CJK.otf'), { family: 'Noto' });
|
||||||
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Emoji.ttf'), { family: 'Noto' });
|
registerFont(path.join(__dirname, '..', '..', 'assets', 'fonts', 'Noto-Emoji.ttf'), { family: 'Noto' });
|
||||||
const coord = [[443, 139], [1200, 143], [443, 637], [1200, 637]];
|
const coord = [[450, 139], [1200, 143], [450, 637], [1200, 637]];
|
||||||
|
|
||||||
module.exports = class GruPlanCommand extends Command {
|
module.exports = class GruPlanCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -53,10 +53,10 @@ module.exports = class GruPlanCommand extends Command {
|
|||||||
const ctx = canvas.getContext('2d');
|
const ctx = canvas.getContext('2d');
|
||||||
ctx.drawImage(base, 0, 0);
|
ctx.drawImage(base, 0, 0);
|
||||||
ctx.fillStyle = 'black';
|
ctx.fillStyle = 'black';
|
||||||
ctx.font = '50px Noto';
|
|
||||||
ctx.textBaseline = 'top';
|
ctx.textBaseline = 'top';
|
||||||
let i = 0;
|
let i = 0;
|
||||||
for (const [x, y] of coord) {
|
for (const [x, y] of coord) {
|
||||||
|
ctx.font = '50px Noto';
|
||||||
const step = steps[i];
|
const step = steps[i];
|
||||||
let fontSize = 50;
|
let fontSize = 50;
|
||||||
while (ctx.measureText(step).width > 1237) {
|
while (ctx.measureText(step).width > 1237) {
|
||||||
|
|||||||
Reference in New Issue
Block a user