Fixed namecard fonts
This commit is contained in:
@@ -1,8 +1,16 @@
|
||||
import { createCanvas, loadImage } from "@napi-rs/canvas";
|
||||
import {createCanvas, GlobalFonts, loadImage} from "@napi-rs/canvas";
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
export class NameCardCreator {
|
||||
constructor(templatePath) {
|
||||
this.templatePath = templatePath;
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
const fullPath = path.join(__dirname, "../../assets/fonts/Fredoka/static/Fredoka-Bold.ttf");
|
||||
GlobalFonts.registerFromPath(
|
||||
fullPath,
|
||||
"Fredoka Bold"
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user