Convert symbol disply

Description

i got unicode id f012 ,then got symbol value EF8092.but is does not display.

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

What LVGL version are you using?

What do you want to achieve?

What have you tried so far?

Code to reproduce

#define LV_SYMBOL_SIGNAL “\xEF\x80\x92”

The code block(s) should be formatted like:

void lv_demo_text(void)
{
    lv_obj_t* scr = lv_disp_get_scr_act(NULL);
    lv_obj_t* label1 = lv_label_create(scr, NULL);
    lv_label_set_text(label1, LV_SYMBOL_SIGNAL);
    lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
 
}

Screenshot and/or video



would you help to check?

What do you expect to see with unicode 0xf012?

U+f012 is no valid (defined) unicode character. So it is not defined within the font files.

i want to display signal like picture

Visit this page and make a font file contain the character f012/LV_SYMBOL_SIGNAL :
https://lvgl.io/tools/fontconverter
use this function to set a font for you label: lv_obj_set_style_local_text_font;

would you share a signal symbol defined within the font files?

i will try to do it

i want to set lable bgcolor.would you give same guidance?

lv_obj_set_style_local_bg_color

lv_obj_t* src = lv_disp_get_scr_act(NULL);
lv_obj_t* lable = lv_label_create(src, NULL);
lv_label_set_text(lable, “hello”);
lv_obj_align(lable, NULL,LV_ALIGN_CENTER,0,0);
lv_obj_set_style_local_bg_color(lable, LV_LABEL_PART_MAIN,LV_STATE_DEFAULT, LV_COLOR_RED);
here is my code.does not dislay red bg color as expected.

@jiamin If I understand that right, you want to set background of the label to red color, is that right? Does that label have any sort of shadow or something? If not, than bg color could not be visible because you will “cover” it with color (and space) of the label. I hope that make sense.

just like sample code show,i does not add any sort of shadow or something.
woud you share a sample code?

This does it:

    lv_obj_t* src   = lv_disp_get_scr_act (NULL);
    lv_obj_t* label = lv_label_create (src, NULL);

    lv_label_set_text                 (label, "Hello again");
    lv_obj_align                      (label, NULL, LV_ALIGN_CENTER, 0, 0);
    lv_obj_set_style_local_bg_color   (label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED);
    lv_obj_set_style_local_bg_opa     (label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_COVER);

thanks a lot

how to set table or list item color?would you give some guidance or sample code?