@@ -260,29 +260,29 @@ def show_business_card(self, *, image_name=None, name_string=None, name_scale=1,
260260 if name_string :
261261 name_group = displayio .Group (scale = name_scale )
262262 name_label = Label (name_font , text = name_string )
263- (_ , _ , width , height ) = name_label .bounding_box
263+ (_ , _ , width , _ ) = name_label .bounding_box
264264 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 ))
266266 name_label .color = 0xFFFFFF
267267 name_group .append (name_label )
268268 business_card_splash .append (name_group )
269269 if email_string_one :
270270 email_group_one = displayio .Group (scale = email_scale_one )
271271 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
273273 email_label_one .width = self .display .width
274274 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 ))
276276 email_label_one .color = 0xFFFFFF
277277 email_group_one .append (email_label_one )
278278 business_card_splash .append (email_group_one )
279279 if email_string_two :
280280 email_group_two = displayio .Group (scale = email_scale_two )
281281 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
283283 email_label_two .width = self .display .width
284284 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 ))
286286 email_label_two .color = 0xFFFFFF
287287 email_group_two .append (email_label_two )
288288 business_card_splash .append (email_group_two )
@@ -329,30 +329,27 @@ def show_badge(self, *, background_color=0xFF0000, foreground_color=0xFFFFFF,
329329 (int (self .display .height * 0.5 )), fill = foreground_color )
330330 splash .append (rect )
331331
332- hello_scale = hello_scale
333332 hello_group = displayio .Group (scale = hello_scale )
334333 hello_label = Label (font = hello_font , text = hello_string )
335- (_ , _ , width , height ) = hello_label .bounding_box
334+ (_ , _ , width , _ ) = hello_label .bounding_box
336335 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 ))
338337 hello_label .color = background_text_color
339338 hello_group .append (hello_label )
340339
341- my_name_is_scale = my_name_is_scale
342340 my_name_is_group = displayio .Group (scale = my_name_is_scale )
343341 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
345343 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 ))
347345 my_name_is_label .color = background_text_color
348346 my_name_is_group .append (my_name_is_label )
349347
350- name_scale = name_scale
351348 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
354351 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 ))
356353 name_label .color = foreground_text_color
357354 name_group .append (name_label )
358355
0 commit comments