mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-10 21:03:01 +00:00
added font logging to news manager
This commit is contained in:
@@ -227,7 +227,9 @@ class NewsManager:
|
|||||||
# Load font
|
# Load font
|
||||||
try:
|
try:
|
||||||
font = ImageFont.truetype(self.font_path, self.font_size)
|
font = ImageFont.truetype(self.font_path, self.font_size)
|
||||||
except:
|
logger.debug(f"Successfully loaded custom font: {self.font_path}")
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Failed to load custom font '{self.font_path}': {e}. Using default font.")
|
||||||
font = ImageFont.load_default()
|
font = ImageFont.load_default()
|
||||||
|
|
||||||
# Calculate text width
|
# Calculate text width
|
||||||
@@ -323,7 +325,9 @@ class NewsManager:
|
|||||||
# Load font
|
# Load font
|
||||||
try:
|
try:
|
||||||
font = ImageFont.truetype(self.font_path, self.font_size)
|
font = ImageFont.truetype(self.font_path, self.font_size)
|
||||||
except:
|
logger.debug(f"Successfully loaded custom font: {self.font_path}")
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Failed to load custom font '{self.font_path}': {e}. Using default font.")
|
||||||
font = ImageFont.load_default()
|
font = ImageFont.load_default()
|
||||||
|
|
||||||
# Calculate vertical position (center the text)
|
# Calculate vertical position (center the text)
|
||||||
@@ -373,7 +377,9 @@ class NewsManager:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
font = ImageFont.truetype(self.font_path, self.font_size)
|
font = ImageFont.truetype(self.font_path, self.font_size)
|
||||||
except:
|
logger.debug(f"Successfully loaded custom font: {self.font_path}")
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Failed to load custom font '{self.font_path}': {e}. Using default font.")
|
||||||
font = ImageFont.load_default()
|
font = ImageFont.load_default()
|
||||||
|
|
||||||
text = "Loading news..."
|
text = "Loading news..."
|
||||||
@@ -397,7 +403,9 @@ class NewsManager:
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
font = ImageFont.truetype(self.font_path, max(8, self.font_size - 2))
|
font = ImageFont.truetype(self.font_path, max(8, self.font_size - 2))
|
||||||
except:
|
logger.debug(f"Successfully loaded custom font: {self.font_path}")
|
||||||
|
except Exception as e:
|
||||||
|
logger.warning(f"Failed to load custom font '{self.font_path}': {e}. Using default font.")
|
||||||
font = ImageFont.load_default()
|
font = ImageFont.load_default()
|
||||||
|
|
||||||
text = f"News Error: {error_msg[:50]}..."
|
text = f"News Error: {error_msg[:50]}..."
|
||||||
|
|||||||
Reference in New Issue
Block a user