From 53ffc12a99bbf27ec07c5588c11be841e3c41eb7 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Wed, 23 Jul 2025 13:26:42 -0500 Subject: [PATCH] baseline tuning --- src/of_the_day_manager.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/of_the_day_manager.py b/src/of_the_day_manager.py index c8161e06..53149722 100644 --- a/src/of_the_day_manager.py +++ b/src/of_the_day_manager.py @@ -175,13 +175,10 @@ class OfTheDayManager: for char in text: face.load_char(char) bitmap = face.glyph.bitmap - # Handle descenders properly - characters like y, g, p, q should extend below baseline - # bitmap_top gives us the distance from baseline to top of bitmap - # For proper baseline alignment, we need to account for descenders - baseline_y = y - # Position glyph so its baseline is at the specified y position + # For proper baseline alignment, position glyphs so their baseline is at y # bitmap_top is the distance from baseline to top of bitmap - glyph_y = baseline_y + face.glyph.bitmap_top - bitmap.rows + # So we position the glyph so its baseline is at the specified y position + glyph_y = y + face.glyph.bitmap_top - bitmap.rows for i in range(bitmap.rows): for j in range(bitmap.width): byte_index = i * bitmap.pitch + (j // 8)