March 30, 2021, 4:03am
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:
lv_obj_t* scr = lv_disp_get_scr_act(NULL);
lv_obj_t* label1 = lv_label_create(scr, NULL);
lv_obj_align(label1, NULL, LV_ALIGN_CENTER, 0, 0);
Screenshot and/or video
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.
March 30, 2021, 6:30am
i want to display signal like picture
March 30, 2021, 8:06am
Visit this page and make a font file contain the character f012/
use this function to set a font for you label: lv_obj_set_style_local_text_font;
March 30, 2021, 8:48am
would you share a signal symbol defined within the font files?
April 1, 2021, 7:20am
i want to set lable bgcolor.would you give same guidance?
April 1, 2021, 9:16am
April 1, 2021, 10:21am
lv_obj_t* src = lv_disp_get_scr_act(NULL);
lv_obj_t* lable = lv_label_create(src, NULL);
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.
April 2, 2021, 2:38am
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);
April 2, 2021, 7:32am
how to set table or list item color?would you give some guidance or sample code?