Best way to make a Celsius sign?

Can someone please recommend the best way to make a celsius sign?

Did you try using the degree symbol?

1 Like

The font you use should contain a degree glyph. The montserrat fonts, which are included in lvgl, have it.
Just add the degree char to your string you want to print (e.g: “0 °C”).
Your source file should be encoded in utf-8.

Yep, the degree symbol has been in for a few years

1 Like

The degrees symbol is in the font that is packaged with LVGL.

° = Press and hold the ALT key and then on the numeric pad (while holding alt) type in 0176. Then release the alt key.

You should be able to directly enter the symbol in your C code because that symbol is ordinal 176 which is within a byte.

1 Like

Thank you everyone!

I didn’t realise it was that easy.

The world of ALT character codes. You can use that to key in just about any character you can think of and characters you didn’t know even existed.

Just a few of them.

alt(11): :male_sign:
alt(12): :female_sign:
alt(0153): ™
alt(0169): ©
alt(0174): ®
alt(0188): ½
alt(0189): ¼
alt(0190): ¾
alt(174): « ** rewind **
alt(0139): ‹ ** skip back **
alt(175): » ** fast forward **
alt(0155): › ** skip forward **
alt(16): ► ** play
alt(9): ○ ** record **
alt(254): ■ ** stop **
alt(240): ≡ ** menu button **
alt(0133): … ** menu button***
alt(241): ±
alt(246): ÷
alt(247): ≈
alt(251): √

https://www.alt-codes.net/

IDK which ones are supported by the native font in LVGL. If I had to take a guess I would think that they are all supported.

Well here is the definitive list of alt codes supported by the font that comes with LVGL

7: •
0149: •
0160: (NBSP)
0176: °
248: °

I am actually surprised by this list. I would have thought at least the media control, menu, copyright, trademark and registered characters would have been included

Hi @kdschlosser ,

There is a good number of ‘Font Awesome’ symbols included in the LVGL fonts see here in the online documentation.

Cheers,

Pete