I can not understand, but labels in list are not diplayed at all.
For to be sure, i launch demo from lv_examples\lv_apps\demo.
And still labels are not displayed.
What the reason may be?
Do you have any font enabled in lv_conf.h
?
Yes, i have.
I use “lv_font_unscii_8” in this way:
lv_theme_set_current(lv_theme_default_init(365, &lv_font_unscii_8));
Did you make it the default font in lv_conf.h
as well? Do other objects (i.e. labels, buttons) display properly?
Yes, i made it the default font. (Is it necessary?)
And… yes, other objects diplays properly.
May be it is about unicode support or something like that?
Are you trying to display normal ASCII symbols or another language? Unscii only includes the general ASCII characters AFAIK.
Usually, you don’t have to set the desired font as default but lv_theme_default
is special because it uses the built-in themes where possible and not creates new ones with the new font.
So in this case, you should set is as a default.
Well, its work, but a little weird.
Symbols appears in my project, when i changed lv_font_unscii_8 to lv_font_roboto_12.
With lv_font_unscii_8 symbols disappears again.
Example (demo_create) still doesn’t display any symbols.
So, i have some quections:
1 Roboto12 has unicode symbols, but unscii doesn’t? Can it be the reason? May be it is the size of font?
2 When i force label to use specific style, then symbols disappers. Although text.color and image.color are specified correctly. Where is a problem?
3 And as i can see, objects inherit style from their parents. So, it doesn’t matter, what style i set for list in theme. If list is not created at active_scr, but as a child, its style will be differ.
For example, it list is created as a child of cont, so i need to set up cont style to change list appearance of list. I think its a little strange, doesn’t it?
4 In “demo_create” there is
lv_list_add_btn(list, LV_SYMBOL_FILE, “New”);
So symbol is used like image. Is it right?
Yes, it’s explained in the second section of the image object documentation.
Did you create a new lv_style_t
object, and forget to copy one of the default styles (i.e. lv_style_transp
for labels)? If you did that, your style will not use the default font.
Can you show a small code sample so I can understand the issue better? If you create the container, then create the list as a child of the container, then change the list’s style, I think it’s supposed to work.
Thanks for detailed answer.
Did you create a new
lv_style_t
object, and forget to copy one of the default styles
No, i used one of the styles in current theme. But I failed to repeat the error now, the symbol does not disappear. Maybe I just messed up something.
then change the list’s style, I think it’s supposed to work.
Of course its work. That is not a point.
I was a little confused by the contents of the “lv_label_create”:
lv_label_set_style(new_label, LV_LABEL_STYLE_MAIN, NULL); /Inherit parent’s style/
And i thought, that other objects are created as well.
But now I looked into the function “lv_list_create”, and saw that “theme.style.list” styles are used for the list.
So, It is not an issue anymore.
I returned to the problem.
There is
copy the list to Range and select FontAwesome.ttf
on the converter page.
So, i look closer on roboto and unscii fonts and find out, that roboto font has two ranges. The second one starts with 61441, so it contains built-in symbols.
But unscii doesn’t contain second range. So - there won`t be built-in symbols.
At least, in my project it is work this way.
Hi everybody.
I returned to the problem.
The page with the converter says “copy the list to Range and select FontAwesome.ttf”.
I decided to take a closer look at the fonts of roboto and unscii and found that the roboto contains two ranges of characters. The second range just includes build-in symbols.
Unscii has only one range and does not cover build-in symbols. It turns out that with the unscii font, characters should not be supported at all.
This is exactly what happens in my project. When i using the unscii font, the characters are not displayed, and when using the roboto, they are displayed.
Any comments?
I don’t really understand. “should not be supported”? Please send the generated C file and screenshot about the settings of the converter.