diff --git a/src/display_manager.py b/src/display_manager.py index 72cb05d3..00c9eebd 100644 --- a/src/display_manager.py +++ b/src/display_manager.py @@ -130,11 +130,15 @@ class DisplayManager: self.small_font = ImageFont.truetype("assets/fonts/PressStart2P-Regular.ttf", 8) logger.info("Press Start 2P small font loaded successfully") - # Add an even smaller font using 4x6.bdf assuming script runs from project root + # Add an even smaller font using 4x6.bdf try: - # Hardcoded relative path from project root - font_path = "assets/fonts/4x6.bdf" - print(f"Attempting to load font from (hardcoded relative): {font_path}") # DEBUG PRINT + # Get directory containing this script + script_dir = os.path.dirname(os.path.abspath(__file__)) + # Construct path relative to this script + relative_font_path = os.path.join(script_dir, "../assets/fonts/4x6.bdf") + # Normalize to absolute path + font_path = os.path.abspath(relative_font_path) + print(f"Attempting to load font from (normalized absolute): {font_path}") # DEBUG PRINT self.extra_small_font = ImageFont.load(font_path) logger.info(f"4x6.bdf extra small font loaded successfully from {font_path}") except Exception as font_err: