diff --git a/assets/fonts/LINESeedJP_TTF_Bd.ttf b/assets/fonts/LINESeedJP_TTF_Bd.ttf new file mode 100644 index 0000000..d781c57 Binary files /dev/null and b/assets/fonts/LINESeedJP_TTF_Bd.ttf differ diff --git a/assets/fonts/LINESeedSansTH_Bd.ttf b/assets/fonts/LINESeedSansTH_Bd.ttf new file mode 100644 index 0000000..6fb6a26 Binary files /dev/null and b/assets/fonts/LINESeedSansTH_Bd.ttf differ diff --git a/src/storyCreator.ts b/src/storyCreator.ts index 5fe631a..8ebb0ae 100644 --- a/src/storyCreator.ts +++ b/src/storyCreator.ts @@ -1,8 +1,12 @@ -import { createCanvas, loadImage } from 'canvas'; +import { createCanvas, loadImage, registerFont } from 'canvas'; const StackBlur = require('stackblur-canvas'); export function storyCreator(animePoster: string, animeName: string) { return new Promise((resolve, reject) => { + // Register fonts + registerFont(`assets/fonts/LINESeedSansTH_Bd.ttf`, { family: 'lineSeed_bold' }); + registerFont(`assets/fonts/LINESeedJP_TTF_Bd.ttf`, { family: 'lineSeed_bold' }); + // Create canvas with a fixed size of 1080x1920 const canvas = createCanvas(1080, 1920); const ctx = canvas.getContext('2d'); @@ -42,7 +46,7 @@ export function storyCreator(animePoster: string, animeName: string) { // Fill anime name animeName ctx.fillStyle = 'black'; - ctx.font = 'bold 55px Arial'; + ctx.font = '55px lineSeed_bold'; // Define the animeName position (adjust as needed) const animeNameX = 250; // X-coordinate