@@ -121,7 +121,7 @@ def __init__(
121
121
) # the local_group will always stay in the self Group
122
122
123
123
self ._font = font
124
- self ._text = text
124
+ self ._text = " " . join ( text . split ( " \t " ))
125
125
126
126
# Create the two-color palette
127
127
self .palette = displayio .Palette (2 )
@@ -204,7 +204,7 @@ def _reset_text(
204
204
text = self ._text
205
205
206
206
if self ._save_text : # text string will be saved
207
- self ._text = text
207
+ self ._text = " " . join ( text . split ( " \t " ))
208
208
else :
209
209
self ._text = None # save a None value since text string is not saved
210
210
@@ -239,7 +239,7 @@ def _reset_text(
239
239
loose_box_y ,
240
240
loose_y_offset ,
241
241
) = self ._text_bounding_box (
242
- text ,
242
+ self . _text ,
243
243
self ._font ,
244
244
self ._line_spacing ,
245
245
) # calculate the box size for a tight and loose backgrounds
@@ -262,7 +262,7 @@ def _reset_text(
262
262
# Place the text into the Bitmap
263
263
self ._place_text (
264
264
self .bitmap ,
265
- text ,
265
+ self . _text ,
266
266
self ._font ,
267
267
self ._line_spacing ,
268
268
self ._padding_left - x_offset ,
@@ -632,6 +632,7 @@ def text(self):
632
632
633
633
@text .setter # Cannot set color or background color with text setter, use separate setter
634
634
def text (self , new_text ):
635
+ new_text = " " .join (new_text .split ("\t " ))
635
636
self ._reset_text (text = new_text , scale = self .scale )
636
637
637
638
@property
0 commit comments