From 3a2956a2c6514a29e7cc2411dc69d8a33064d680 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Wed, 23 Jul 2025 11:18:15 -0500 Subject: [PATCH] OTD formatting errors with BDF font --- src/of_the_day_manager.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/of_the_day_manager.py b/src/of_the_day_manager.py index 00064eb9..d1377319 100644 --- a/src/of_the_day_manager.py +++ b/src/of_the_day_manager.py @@ -206,13 +206,15 @@ class OfTheDayManager: # Calculate title width and actual height for proper spacing title_width = 0 max_title_height = 0 + baseline_offset = title_face.size.height - title_face.size.ascender for c in title: title_face.load_char(c) title_width += title_face.glyph.advance.x - # Track the maximum height of any character in the title + # Track the maximum height including baseline offset bitmap = title_face.glyph.bitmap - if bitmap.rows > max_title_height: - max_title_height = bitmap.rows + actual_height = baseline_offset + bitmap.rows + if actual_height > max_title_height: + max_title_height = actual_height title_width = title_width // 64 # Underline below title using actual title height