mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
changed calendar summary from 4x6 to 5x7
This commit is contained in:
@@ -175,26 +175,26 @@ class DisplayManager:
|
||||
self.small_font = ImageFont.truetype("assets/fonts/PressStart2P-Regular.ttf", 8)
|
||||
logger.info("Press Start 2P small font loaded successfully")
|
||||
|
||||
# Load 4x6 BDF font for calendar events
|
||||
# Load 5x7 BDF font for calendar events
|
||||
try:
|
||||
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||
relative_font_path = os.path.join(script_dir, "../assets/fonts/4x6.bdf")
|
||||
relative_font_path = os.path.join(script_dir, "../assets/fonts/5x7.bdf")
|
||||
self.calendar_font_path = os.path.abspath(relative_font_path)
|
||||
logger.info(f"Attempting to load 4x6 font from: {self.calendar_font_path}")
|
||||
logger.info(f"Attempting to load 5x7 font from: {self.calendar_font_path}")
|
||||
|
||||
if not os.path.exists(self.calendar_font_path):
|
||||
raise FileNotFoundError(f"Font file not found at {self.calendar_font_path}")
|
||||
|
||||
# Load with freetype for proper BDF handling
|
||||
face = freetype.Face(self.calendar_font_path)
|
||||
logger.info(f"4x6 calendar font loaded successfully from {self.calendar_font_path}")
|
||||
logger.info(f"5x7 calendar font loaded successfully from {self.calendar_font_path}")
|
||||
logger.info(f"Calendar font size: {face.size.height >> 6} pixels")
|
||||
|
||||
# Store the face for later use
|
||||
self.calendar_font = face
|
||||
|
||||
except Exception as font_err:
|
||||
logger.error(f"Failed to load 4x6 font: {str(font_err)}", exc_info=True)
|
||||
logger.error(f"Failed to load 5x7 font: {str(font_err)}", exc_info=True)
|
||||
logger.error("Falling back to small font")
|
||||
self.calendar_font = self.small_font
|
||||
|
||||
|
||||
Reference in New Issue
Block a user