Refactor code structure for improved readability and maintainability

This commit is contained in:
Slipstream 2025-05-20 20:46:13 -06:00
parent 8cac1bddc4
commit 6c39bec4f7
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 2 additions and 1 deletions

BIN
FONT/DejaVuSans.ttf Normal file

Binary file not shown.

View File

@ -150,8 +150,9 @@ def generate_board_image(game: WordleGame, used_letters: Set[str] = None) -> dis
SCRIPT_DIR = os.path.dirname(os.path.abspath(__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 PROJECT_ROOT = os.path.dirname(os.path.dirname(SCRIPT_DIR)) # Go up two levels from games dir
FONT_DIR_NAME = "FONT" # Directory specified by user FONT_DIR_NAME = "FONT" # Directory specified by user
FONT_FILE_NAME = "DejaVuSansMono.ttf" FONT_FILE_NAME = "DejaVuSans.ttf"
font_path = os.path.join(PROJECT_ROOT, "..", "..", FONT_DIR_NAME, FONT_FILE_NAME) font_path = os.path.join(PROJECT_ROOT, "..", "..", FONT_DIR_NAME, FONT_FILE_NAME)
print(f"Font path: {font_path}")
# Try to load the font # Try to load the font
font = ImageFont.truetype(font_path, size=int(SQUARE_SIZE * 0.6)) font = ImageFont.truetype(font_path, size=int(SQUARE_SIZE * 0.6))