Is there a way to change label text size?


How to change the label text size?

What do you want to achieve?

The label text default size is 16x16 in my device. I want to change the font size to 32x32.

What have you tried so far?

I’ve tried lv_obj_set_size/width. But it didn’t work for me.

Thank you,
Xi Chen

You need to change the font of the label using styles.

You need to create new font with online converter (i cant add link, use search in lvgl site)
In this form you may set text height.

With you own font you may use unicode characters, unlike embedded font.

static lv_style_t st;
lv_style_set_text_font(&st, LV_STATE_DEFAULT, &arial70px);

label_clock = lv_label_create(lv_scr_act(), NULL);

lv_obj_add_style(label_clock, LV_LABEL_PART_MAIN , &st);


Thank you. I think it’s the only way I can change the font size.