feat: Update font directory and file for Wordle game board image generation
This commit is contained in:
parent
970052dc66
commit
8cac1bddc4
@ -149,9 +149,9 @@ def generate_board_image(game: WordleGame, used_letters: Set[str] = None) -> dis
|
||||
# Construct path relative to this script file
|
||||
SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(SCRIPT_DIR)) # Go up two levels from games dir
|
||||
FONT_DIR_NAME = "dejavusans" # Directory specified by user
|
||||
FONT_FILE_NAME = "DejaVuSans.ttf"
|
||||
font_path = os.path.join(PROJECT_ROOT, FONT_DIR_NAME, FONT_FILE_NAME)
|
||||
FONT_DIR_NAME = "FONT" # Directory specified by user
|
||||
FONT_FILE_NAME = "DejaVuSansMono.ttf"
|
||||
font_path = os.path.join(PROJECT_ROOT, "..", "..", FONT_DIR_NAME, FONT_FILE_NAME)
|
||||
|
||||
# Try to load the font
|
||||
font = ImageFont.truetype(font_path, size=int(SQUARE_SIZE * 0.6))
|
||||
|
Loading…
x
Reference in New Issue
Block a user