[SOLVED] How to draw "icon" characters from KeyPress::getTextDescriptionWithIcons

The KeyPress::getTextDescriptionWithIcons returns nice special characters representing modifier keys, such as control, command and option, with standard symbols. How can these characters be painted i.e. drawn to the screen with Graphics?

I see that the strings are alright in debugger. The symbols show correctly in Xcode, but drawText renders them wrong. The symbols look like letters from Arabic.

Symbol ⌘ shows right in Xcode:

This is what drawText ends up with

Screenshot 2022-09-15 at 17.01.51

I quickly tried with different fonts, but that didn’t seem to fix it. Should i just look for a better font, or is this a dead end?

[EDIT] The right font solves this.

To anyone interested, finding a font that has these symbols solves this problem.

1 Like