revert daily weather temp font change due to negative effects on other displays

This commit is contained in:
Chuck
2025-07-23 14:27:50 -05:00
parent 723b7ce190
commit b5b18babe8
3 changed files with 8 additions and 110 deletions

View File

@@ -503,23 +503,12 @@ class WeatherManager:
# Draw high/low temperatures at bottom (without degree symbol)
temp_text = f"{forecast['temp_low']} / {forecast['temp_high']}" # Removed degree symbols
# Use MatrixLight6 font for temperature text
if hasattr(self.display_manager, 'matrix_light6_font'):
# For BDF fonts, we need to calculate width manually and use _draw_bdf_text
temp_width = self.display_manager.get_text_width(temp_text, self.display_manager.matrix_light6_font)
# Calculate y position for BDF font at bottom
self.display_manager.matrix_light6_font.load_char('A')
font_height = self.display_manager.matrix_light6_font.glyph.bitmap.rows
temp_y = self.display_manager.matrix.height - font_height - 1 # Position at bottom with small margin
self.display_manager._draw_bdf_text(temp_text, center_x - temp_width // 2, temp_y, self.COLORS['text'], self.display_manager.matrix_light6_font)
else:
# Fallback to extra_small font
temp_width = draw.textlength(temp_text, font=self.display_manager.extra_small_font)
temp_y = self.display_manager.matrix.height - 8 # Position at bottom with small margin
draw.text((center_x - temp_width // 2, temp_y),
temp_text,
font=self.display_manager.extra_small_font,
fill=self.COLORS['text'])
temp_width = draw.textlength(temp_text, font=self.display_manager.extra_small_font)
temp_y = self.display_manager.matrix.height - 8 # Position at bottom with small margin
draw.text((center_x - temp_width // 2, temp_y),
temp_text,
font=self.display_manager.extra_small_font,
fill=self.COLORS['text'])
# Update the display
self.display_manager.image = image