mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-11 21:33:00 +00:00
baseline shift
This commit is contained in:
@@ -175,10 +175,10 @@ class OfTheDayManager:
|
|||||||
for char in text:
|
for char in text:
|
||||||
face.load_char(char)
|
face.load_char(char)
|
||||||
bitmap = face.glyph.bitmap
|
bitmap = face.glyph.bitmap
|
||||||
# For LED matrix displays, we need pixel-perfect baseline rendering
|
# For bottom baseline alignment, we need to position glyphs so their bottoms align
|
||||||
# Use the glyph's bitmap_top to position relative to the baseline
|
# bitmap_top gives us the distance from baseline to top of bitmap
|
||||||
# This ensures all characters align properly regardless of their height
|
# For bottom alignment, we want the bottom of each glyph at the same y position
|
||||||
glyph_y = y + face.glyph.bitmap_top - bitmap.rows
|
glyph_y = y - bitmap.rows
|
||||||
for i in range(bitmap.rows):
|
for i in range(bitmap.rows):
|
||||||
for j in range(bitmap.width):
|
for j in range(bitmap.width):
|
||||||
byte_index = i * bitmap.pitch + (j // 8)
|
byte_index = i * bitmap.pitch + (j // 8)
|
||||||
|
|||||||
Reference in New Issue
Block a user