ucglib icon indicating copy to clipboard operation
ucglib copied to clipboard

cannot print degree ° symbol

Open rotarucosminleonard opened this issue 5 years ago • 3 comments

I cannot print the degree symbol on my st7739 display. It just does not show up.

rotarucosminleonard avatar Aug 03 '19 21:08 rotarucosminleonard

Did you check if your font does support this ? ucg.print("\0xb0") should do that, no problem i see as long the font supports. What font exactly did you try ?

iltis42 avatar Oct 22 '19 13:10 iltis42

the same problem! tested with ("°" also with "\0xb0") Display: 1.77 TFT 160x128 Fonds: ucg.setFont(ucg_font_7x13_mr); ucg.setFont(ucg_font_courR12_mr); ucg.setFont(ucg_font_courR10_mr); ucg.setFont(ucg_font_profont10_mr);

Which font works?

EDIT: in my case the solution was change "ucg.setFont(ucg_font_7x13_mr);" to "ucg.setFont(ucg_font_7x13_tf);"

print ucg.print("\xb0"); // Print °

Sub-7 avatar Dec 14 '19 22:12 Sub-7

I think this might be an issue with Arduino string encoding rather than with ucglib. The following works for me (note: no quotes around it, this is the raw byte notation of the ASCII character!)

ucg.drawGlyph(x, y, 0, 0xb0); // degree sign

kevinstadler avatar Apr 24 '20 03:04 kevinstadler