Same font, 1 and 2 show different sizes

Description

What MCU/Processor/Board and compiler are you using?

PC similator

What do you expect?

  • How do I make 1 and 2 display the same size

Code to reproduce

Add a code snippet to reproduce the issue in the simulator. It should contain only the relevant code which can be compiled. Bug reports without code snippets or with erroneous code snippets will not be reviewed.

Use the ```c and ``` tags to format your code:

     lv_obj_t* obj = lv_obj_create(lv_scr_act(), NULL);
     lv_obj_set_size(obj, LV_HOR_RES, LV_VER_RES);
     lv_obj_t* cont = lv_cont_create(obj, NULL);
     lv_cont_set_fit2(cont, LV_FIT_NONE, LV_FIT_TIGHT);
     lv_obj_t* label = lv_label_create(cont, NULL);
     lv_obj_align(cont,obj, LV_ALIGN_CENTER, 0, 0);
     lv_label_set_text(label, "1111");
     
    
     cont = lv_cont_create(obj, NULL);
     lv_cont_set_fit2(cont, LV_FIT_NONE, LV_FIT_TIGHT);
      label = lv_label_create(cont, NULL);
     lv_obj_align(cont,obj, LV_ALIGN_CENTER, 0, 60);
     lv_label_set_text(label, "2222");

Screenshot and/or video

If possible, add screenshots and/or videos about the current issue.

I think the Windows font is monospace and the other one isn’t.

  • Thanks for your reply,The problem has been solved,Only the values of LV_font_fmt_txt_glyph_dsc_t structure members adv_w and OFs_x are adjusted so that the number 1 is equally wide and centered.