Main Site Documentation

° (degree) in c# String


#1

Does somebody know how to display ° on the screen of DisplayT35??
My variable is String. (I use SimpleGraphics.DisplayText of Display_T35 of .NetGadgeteer.)
I’m looking for it in the internet for at least one hour but didn’t find a solution…


#2

According to http://www.asciitable.com/ the degree symbol is a part of the extended ASCII codes. Using the Extended ASCII table currently has issues when attempting to resolve the length of the string. It will cut off the last char in your string for every extended ascii char you have in your string. This is an issue with the NETMF core, and has been reported to microsoft.

However, you can always call any character by it’s HEX code, 0x–


#3

display_T35.SimpleGraphics.DisplayText(“The temperature is 13 °F”, System.Resources.GetFont(System.Resources.FontResources.NinaB), Color.Black, 0, 0);

To display the ° symbol, type 0176 while holding down the “ALT” key on your keypad.


#4

While holding down ALT key, it’s not possible to enter something :frowning:
I tried it also with Alt Gr but then only }{ appears…


#5

the alt key codes only work with a keyboard with a seperate numeric keypad.


#6

That works!
Thank you very much!


#7

Hi,

I tried the same with another font that I have created with tiny tool. And now ° isn’t shown with ALT + 0176.


#8

You probably did not include the ° character in the TinyFont when converting the True Type Font. Look at the attached picture an make sure you include the degree symbol in the TinyFont generated by the Tool.


#9

OK. Thank you!


#10

Perfect! Just what I was looking for!