Skip to content

Commit

Permalink
(UI): Change font
Browse files Browse the repository at this point in the history
  • Loading branch information
kang49 committed Mar 15, 2024
1 parent 7c42209 commit 09f3497
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Binary file added assets/fonts/LINESeedJP_TTF_Bd.ttf
Binary file not shown.
Binary file added assets/fonts/LINESeedSansTH_Bd.ttf
Binary file not shown.
8 changes: 6 additions & 2 deletions src/storyCreator.ts
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 09f3497

Please sign in to comment.