Vertical Text?

Hello,

I was wondering if there is an easy way to do vertical text in wxPython?
(Either A Static Text Ctrl which renders the text vertically or rotated
by 90 degrees.)

I'm pondering two methods to do it,
- Split the text into individual characters and put them in a Vertical
Box sizer.
- Rendering to a DC and rotating the DC by 90 degrees.

Any ideas? Anyone implemented code to do this?

Thanks for your help.

Tim Ansell

Tim Ansell wrote:

I was wondering if there is an easy way to do vertical text in wxPython?
(Either A Static Text Ctrl which renders the text vertically or rotated
by 90 degrees.)

I'm pondering two methods to do it,
- Split the text into individual characters and put them in a Vertical
Box sizer.

That I wouldn't do -- it just seems very heavyweight

- Rendering to a DC and rotating the DC by 90 degrees.

That would work OK, or, if you'd rather have the text vertical, but the letter normal, you could render each letter with a DC, using DC.GetTextExtents to figure out where to place all the letters.

I imagine that the Generic StaticText :

wx.lib.stattext.GenStaticText

would be a good place to start.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Christopher Barker wrote:

Tim Ansell wrote:

- Rendering to a DC and rotating the DC by 90 degrees.

That would work OK,

A note: you can draw rotated text on a DC, rather than rotating the DC itself.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov