Skip to content

Commit 4a740b9

Browse files
committed
Added .75 linespacing to all labels for better multiline
1 parent 2cdaf76 commit 4a740b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

adafruit_pybadger.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
272272
if isinstance(name_font, str):
273273
name_font = load_font(name_font, name_string)
274274
name_group = displayio.Group(scale=name_scale)
275-
name_label = Label(name_font, text=name_string)
275+
name_label = Label(name_font, text=name_string, line_spacing=0.75)
276276
(_, _, width, _) = name_label.bounding_box
277277
name_label.x = ((self.display.width // (2 * name_scale)) - width // 2)
278278
name_label.y = int(self.display.height * (0.73 / name_scale))
@@ -283,7 +283,7 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
283283
if isinstance(email_font_one, str):
284284
email_font_one = load_font(email_font_one, email_string_one)
285285
email_group_one = displayio.Group(scale=email_scale_one)
286-
email_label_one = Label(email_font_one, text=email_string_one)
286+
email_label_one = Label(email_font_one, text=email_string_one, line_spacing=0.75)
287287
(_, _, width, _) = email_label_one.bounding_box
288288
email_label_one.width = self.display.width
289289
email_label_one.x = ((self.display.width // (2 * email_scale_one)) - width // 2)
@@ -295,7 +295,7 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
295295
if isinstance(email_font_two, str):
296296
email_font_two = load_font(email_font_two, email_string_two)
297297
email_group_two = displayio.Group(scale=email_scale_two)
298-
email_label_two = Label(email_font_two, text=email_string_two)
298+
email_label_two = Label(email_font_two, text=email_string_two, line_spacing=0.75)
299299
(_, _, width, _) = email_label_two.bounding_box
300300
email_label_two.width = self.display.width
301301
email_label_two.x = ((self.display.width // (2 * email_scale_two)) - width // 2)
@@ -349,7 +349,7 @@ def show_badge(self, *, background_color=0xFF0000, foreground_color=0xFFFFFF,
349349
if isinstance(hello_font, str):
350350
hello_font = load_font(hello_font, hello_string)
351351
hello_group = displayio.Group(scale=hello_scale)
352-
hello_label = Label(font=hello_font, text=hello_string)
352+
hello_label = Label(font=hello_font, text=hello_string, line_spacing=0.75)
353353
(_, _, width, _) = hello_label.bounding_box
354354
hello_label.x = ((self.display.width // (2 * hello_scale)) - width // 2)
355355
hello_label.y = int(self.display.height * (0.117 / hello_scale))
@@ -359,7 +359,7 @@ def show_badge(self, *, background_color=0xFF0000, foreground_color=0xFFFFFF,
359359
if isinstance(my_name_is_font, str):
360360
my_name_is_font = load_font(my_name_is_font, my_name_is_string)
361361
my_name_is_group = displayio.Group(scale=my_name_is_scale)
362-
my_name_is_label = Label(font=my_name_is_font, text=my_name_is_string)
362+
my_name_is_label = Label(font=my_name_is_font, text=my_name_is_string, line_spacing=0.75)
363363
(_, _, width, _) = my_name_is_label.bounding_box
364364
my_name_is_label.x = ((self.display.width // (2 * my_name_is_scale)) - width // 2)
365365
my_name_is_label.y = int(self.display.height * (0.28 / my_name_is_scale))

0 commit comments

Comments
 (0)