@@ -260,29 +260,29 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
260
260
if name_string :
261
261
name_group = displayio .Group (scale = name_scale )
262
262
name_label = Label (name_font , text = name_string )
263
- (_ , _ , width , height ) = name_label .bounding_box
263
+ (_ , _ , width , _ ) = name_label .bounding_box
264
264
name_label .x = ((self .display .width // (2 * name_scale )) - width // 2 )
265
- name_label .y = int (height // (0.15 * name_scale ))
265
+ name_label .y = int (self . display . height * (0.73 / name_scale ))
266
266
name_label .color = 0xFFFFFF
267
267
name_group .append (name_label )
268
268
business_card_splash .append (name_group )
269
269
if email_string_one :
270
270
email_group_one = displayio .Group (scale = email_scale_one )
271
271
email_label_one = Label (email_font_one , text = email_string_one )
272
- (_ , _ , width , height ) = email_label_one .bounding_box
272
+ (_ , _ , width , _ ) = email_label_one .bounding_box
273
273
email_label_one .width = self .display .width
274
274
email_label_one .x = ((self .display .width // (2 * email_scale_one )) - width // 2 )
275
- email_label_one .y = int (height // (0.13 * email_scale_one ))
275
+ email_label_one .y = int (self . display . height * (0.84 / email_scale_one ))
276
276
email_label_one .color = 0xFFFFFF
277
277
email_group_one .append (email_label_one )
278
278
business_card_splash .append (email_group_one )
279
279
if email_string_two :
280
280
email_group_two = displayio .Group (scale = email_scale_two )
281
281
email_label_two = Label (email_font_two , text = email_string_two )
282
- (_ , _ , width , height ) = email_label_two .bounding_box
282
+ (_ , _ , width , _ ) = email_label_two .bounding_box
283
283
email_label_two .width = self .display .width
284
284
email_label_two .x = ((self .display .width // (2 * email_scale_two )) - width // 2 )
285
- email_label_two .y = int (height // (0.12 * email_scale_two ))
285
+ email_label_two .y = int (self . display . height * (0.91 / email_scale_two ))
286
286
email_label_two .color = 0xFFFFFF
287
287
email_group_two .append (email_label_two )
288
288
business_card_splash .append (email_group_two )
@@ -329,30 +329,27 @@ def show_badge(self, *, background_color=0xFF0000, foreground_color=0xFFFFFF,
329
329
(int (self .display .height * 0.5 )), fill = foreground_color )
330
330
splash .append (rect )
331
331
332
- hello_scale = hello_scale
333
332
hello_group = displayio .Group (scale = hello_scale )
334
333
hello_label = Label (font = hello_font , text = hello_string )
335
- (_ , _ , width , height ) = hello_label .bounding_box
334
+ (_ , _ , width , _ ) = hello_label .bounding_box
336
335
hello_label .x = ((self .display .width // (2 * hello_scale )) - width // 2 )
337
- hello_label .y = int (height // ( 1.2 * hello_scale ))
336
+ hello_label .y = int (self . display . height * ( 0.117 / hello_scale ))
338
337
hello_label .color = background_text_color
339
338
hello_group .append (hello_label )
340
339
341
- my_name_is_scale = my_name_is_scale
342
340
my_name_is_group = displayio .Group (scale = my_name_is_scale )
343
341
my_name_is_label = Label (font = my_name_is_font , text = my_name_is_string )
344
- (_ , _ , width , height ) = my_name_is_label .bounding_box
342
+ (_ , _ , width , _ ) = my_name_is_label .bounding_box
345
343
my_name_is_label .x = ((self .display .width // (2 * my_name_is_scale )) - width // 2 )
346
- my_name_is_label .y = int (height // (0.42 * my_name_is_scale ))
344
+ my_name_is_label .y = int (self . display . height * (0.28 / my_name_is_scale ))
347
345
my_name_is_label .color = background_text_color
348
346
my_name_is_group .append (my_name_is_label )
349
347
350
- name_scale = name_scale
351
348
name_group = displayio .Group (scale = name_scale )
352
- name_label = Label (font = name_font , text = name_string )
353
- (_ , _ , width , height ) = name_label .bounding_box
349
+ name_label = Label (font = name_font , text = name_string , line_spacing = 0.75 )
350
+ (_ , _ , width , _ ) = name_label .bounding_box
354
351
name_label .x = ((self .display .width // (2 * name_scale )) - width // 2 )
355
- name_label .y = int (height // (0.17 * name_scale ))
352
+ name_label .y = int (self . display . height * (0.65 / name_scale ))
356
353
name_label .color = foreground_text_color
357
354
name_group .append (name_label )
358
355
0 commit comments