Setting text in LV_LABEL_LONG_DOT mode

Hello!

When placing text that is longer than the label, the formatting of that text is not good.
According to the visible images, the text is much shorter than the width of the label.
How to fix the incorrect printing. The code is simulated

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

ESP32-C3, ESP-IDF v5.0

What LVGL version are you using?

v8.3.9

Thanks in advance

lv_obj_t* label1;

void lv_example_label(void)
{
    label1 = lv_label_create(lv_scr_act());
    lv_obj_set_style_bg_color(lv_scr_act(), lv_color_make(0x41, 0x78, 0xbc), 0);
    lv_obj_set_style_bg_opa(lv_scr_act(), LV_OPA_100, 0);

    lv_label_set_long_mode(label1, LV_LABEL_LONG_DOT);      
    lv_obj_set_style_text_align(label1, LV_TEXT_ALIGN_CENTER, 0);
    lv_obj_set_width(label1, 100);
    lv_obj_set_height(label1, 15);
    lv_label_set_text(label1, "Max. temperature");
    lv_obj_align(label1, LV_ALIGN_CENTER, 0, 40);
    lv_obj_set_style_bg_color(label1, lv_color_make(0xff, 0x45, 0x7c), 0);
    lv_obj_set_style_bg_opa(label1, LV_OPA_100, 0);
}

image

Please help @kisvegabor :slightly_smiling_face:

Thank you very much

Hi,

It’s resolved in v9. Can you update LVGL to the latest?

This PR fixed in v9. If you can’t update to v9, you can try backporting it.

Dear sir, thank you for your reply.

Unfortunately, I can’t upgrade to v9 right now because I’m 99.9% done with devices that have screens made with LVGL v8. I’m in the final stages of testing and fixing issues I’ve noticed LVGL has. I’ve run into a few, this is one of them. There are more that I haven’t asked for a bug fix for anywhere.

My goal is to fix the necessary functions within LVGL v8, which will solve the observed problem.

Tnx

Oh, I’m sorry to hear that. In this case I recommend applying some custom workarounds, like manually setting a “dotted” text.