Search code examples
pythonwxpython

How to rotate the text of a wx.StaticText?


I want to write a Static Text with an upside down ^ How can I do it?


Solution

  • There are a couple of approaches.

    1) If you actually want to do the rotation, you can do it by drawing the text to a wx.GraphicsContext and then rotation it there, write this to a bitmap, and display that.

    2) It might be easier to find the right unicode symbol. Having spent way too much of my time lately looking at unicode symbols, I can suggest 02C7, 032C, 2228, 2304, 1D5B, 1D65. Note, though, that not all of these will be present in all fonts.

    As far as I know, wx.StaticText doesn't rotate text.