Skip to content
This repository has been archived by the owner on Nov 15, 2024. It is now read-only.

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
LewdHuTao committed Apr 19, 2024
1 parent e9f8d93 commit f2bf625
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "songcard",
"version": "1.1.5",
"version": "1.1.6",
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
5 changes: 2 additions & 3 deletions src/themes/classicCard.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { createCanvas, loadImage } = require("canvas");
const { createCanvas, loadImage, registerFont } = require("canvas");
const Jimp = require("jimp");
const path = require("path");

Expand All @@ -9,9 +9,8 @@ async function classicCard({
trackDuration,
trackTotalDuration,
}) {
const Canvas = require("canvas");
const fontPath = path.join(__dirname, '..', 'fonts', 'NotoSans-Regular.ttf');
Canvas.registerFont(fontPath, { family: "Noto Sans" });
registerFont(fontPath, { family: "Noto Sans" });

const prettyMilliseconds = (await import("pretty-ms")).default;
const canvasWidth = 1200;
Expand Down
5 changes: 2 additions & 3 deletions src/themes/simpleCard.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
const { createCanvas, loadImage } = require("canvas");
const { createCanvas, loadImage, registerFont } = require("canvas");
const Jimp = require("jimp");
const path = require("path");

async function simpleCard({ imageBg, imageText }) {
const Canvas = require("canvas");
const fontPath = path.join(__dirname, '..', 'fonts', 'NotoSans-Regular.ttf');
Canvas.registerFont(fontPath, { family: "Noto Sans" });
registerFont(fontPath, { family: "Noto Sans" });

const canvasWidth = 600;
const canvasHeight = 600;
Expand Down

0 comments on commit f2bf625

Please sign in to comment.