Skip to content

Commit

Permalink
path change
Browse files Browse the repository at this point in the history
  • Loading branch information
maamokun committed Aug 12, 2024
1 parent 0f44e05 commit 8241b12
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/gen/level.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { join } from "node:path";
import { createCanvas, loadImage, GlobalFonts } from "@napi-rs/canvas";

GlobalFonts.registerFromPath(join(__dirname, "../assets/HSR.otf"), "HSR");
const fontPath = join(cwd(), "assets", "HSR.otf");
console.log(`Registering font from path: ${fontPath}`);

GlobalFonts.registerFromPath(fontPath, "HSR");

export async function createLevel({
level,
Expand Down Expand Up @@ -196,3 +199,7 @@ export async function createLevel({

return await canvas.encode("png");
}
function cwd(): string {
return process.cwd();
}

0 comments on commit 8241b12

Please sign in to comment.