elgerg
October 3, 2019, 7:17pm
#1
Hi,
I was wondering how to get a degree symbol to appear in LVGL.
Ive tried:
normal degree:
lv_table_set_cell_value(sensorTable, 1, 1, “20.25ºC”);
bodmer degree symbol replacement:
lv_table_set_cell_value(sensorTable, 1, 1, “20.25`C”);
edit:
I also tried:
lv_table_set_cell_value(sensorTable, 1, 1, “20.25°C”);
based on the degree symbol from:
Unicode web service for character search. Find, copy and paste your favorite characters: 😎 Emoji, ❤ Hearts, 💲 Currencies, → Arrows, ★ Stars and many others 🚩
but i get nothing.
Any ideas?
Thanks
Alex
As far as I know the degree symbol is outside the basic ASCII range (0x20-0x7F
). You need to add it to the converted font.
elgerg
October 4, 2019, 10:22pm
#3
Ah, in which case can you tell me what the default font, size and BPP is for the night theme? I’ll need to create a font specifically for writing out my temps. Ive tried a number of different roboto ones but they dont look as good as the default one…
Ive tried to figure it out by looking at the source but must admit i’m getting out of my depth on that one…
Thanks
Alex
The original Roboto is here: https://github.com/littlevgl/lvgl/tree/master/scripts/built_in_font
I’m pretty sure each of the 4 builtin Roboto fonts were converted with 4BPP, and you can figure out their size from their name.
elgerg:
for the night theme?
Themes do not choose the default font; you do (in lv_conf.h
).
elgerg
October 7, 2019, 7:42pm
#5
Thank you for the pointer,
The answer is 4BPP, Size 16 but the crucial part is “Roboto Regular”. I tried most of the others and didn’t notice the “regular” option…
Thanks for the pointer and help
Alex