I’m making a gauge for a flight simulator.
I can’t figure out how to create my own icons for the file
lib\lvgl\src\font\lv_symbol_def.h
I want to draw an icon with slanted strokes, like this altimeter
Now I use the
LV_SYMBOL_BARS
symbol for my device
I use it in the code like this
// scale from 0 to 9 with a minus, for airfields below sea level
lv_roller_set_options(ui_Roller3, LV_SYMBOL_BARS "\n"
"0\n1\n2\n3\n4\n5\n6\n7\n8\n9", LV_ROLLER_MODE_INFINITE);
I found a rather confusing, at least for me, instruction:
https://docs.lvgl.io/master/details/main-components/font.html#adding-new-symbols
And as far as I understood it, you can only add a symbol through fonts, and the fonts must be from the FontAwesome sets, i.e. you can’t draw and add an icon yourself?
I would be grateful if someone could help me draw the icon I need and convert it.
For example, I tried to add an icon on the first try.
Found the symbol codes here:
Copied the symbol code BAR_CODE and added it to the lv_symbol_def.h file
It turned out like this
#if !defined LV_SYMBOL_BAR_CODE
#define LV_SYMBOL_BAR_CODE "\xef\x80\xaa"
#endif
I specified the symbol display in the project code, but the font was not detected on the device.
As far as I understand, in the lv_conf.h file, line 371, the default font is declared
#define LV_FONT_CUSTOM_DECLARE
and the font needed is fontawesome-webfont.ttf
I made the second attempt according to the instructions, found the symbol here
Copied it to the e562 font converter
Downloaded the font fontawesome-webfont.ttf, started converting and got an error about the symbol missing inside the font.
In general, I am confused and cannot figure out this process myself
I want to learn how to do this.
Thanks in advance to the community.