mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-04-12 05:42:59 +00:00
bitmap fonts are outrageous
This commit is contained in:
@@ -171,8 +171,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
|
||||||
# Use bitmap_top to properly position the glyph relative to baseline
|
# Calculate baseline position
|
||||||
glyph_y = y + face.glyph.bitmap_top
|
# bitmap_top is the distance from baseline to top of bitmap
|
||||||
|
baseline_y = y
|
||||||
|
glyph_y = baseline_y + face.glyph.bitmap_top
|
||||||
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