Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion adafruit_display_text/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ def measure(text):
font.load_glyphs(string)

def measure(text):
return sum(font.get_glyph(ord(c)).shift_x for c in text)
total_len = 0
for char in text:
this_glyph = font.get_glyph(ord(char))
if this_glyph:
total_len += this_glyph.shift_x
return total_len

lines = []
partial = [indent0]
Expand Down