Skip to content

Commit

Permalink
fix: font path error.
Browse files Browse the repository at this point in the history
  • Loading branch information
trend-joshua-tseng committed Apr 15, 2024
1 parent 1fcef59 commit 4554a0a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import string
from argparse import ArgumentParser, ArgumentTypeError

Expand All @@ -14,6 +15,8 @@

logger = Logger('app')

_script_path = os.path.dirname(os.path.abspath(__file__))


def check_positive(value):
value = int(value)
Expand All @@ -32,7 +35,7 @@ def text_to_gif(text: str, frame: int, delay: int, font: str, save: bool, text_c
input_string = text

if font is None:
font = '../font/Arial Unicode.ttf'
font = f'{_script_path}/../font/Arial Unicode.ttf'

logger.debug('text', input_string)
logger.debug('frame', frame)
Expand Down

0 comments on commit 4554a0a

Please sign in to comment.