Hello!
I am using the new v7 dark theme but I need the degree( º ) symbol. How can I use it?
Thank you once again!
I don’t think we ship this symbol out of the box; here are the instructions on how to add it to the font converter.
https://docs.lvgl.io/latest/en/html/overview/font.html#add-new-symbols
In your case you shouldn’t need to add FontAwesome, as this is a standard Unicode character. However, you do need a base font (Montserrat, Dejavu, etc.). The Unicode ID for the degree symbol is 0x00B0
and the UTF-8 byte sequence to use is \xC2\xB0
.
I’m not entirely sure how you get the MicroPython binding script to pick up on the new font; maybe @amirgon can help you with that.
You can link the font on compile time, or load it on runtime.
- On compile time it’s exactly like standard LVGL application.You just build the Micropython firmware with the new font and it would become available in Micropython.
- On runtime - see an example script.
Actually, the degree symbol is included in the built-in fonts because it’s quite common.
Thank you everyone for your help!
For future reference, as @kisvegabor stated it is already included and one can simply do:
s=u"\u00B0"
value = "{:.1f} {}C".format(temperature, s)
tempValueLabel.set_text(value)
Thank you!