May 01, 2024, 01:34:10 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Vertical Text

Started by LarryMc, April 07, 2009, 04:17:42 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

I need a easy way to create vertical text in a device context.

I'm NOT talking about rotating a horizontal line of text like the attached.

I want to be able to output a line of text like this:
QuoteV
    e
    r
    t
    i
    c
    a
    l

I've played with all the parameters of LOGFONT without any luck.
The only way I can think of is putting it in a loop for each letter; getting the extents; textout the letter; then increment the y.

I need to use getextents to allow for different size fonts.

Anyone know of an easy way?

Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Stumbled across the answer.
All I have to do is:
1.  switch from using TextOut to DrawText
2. insert \n between each of the letters.

Everything lines up perfect


Larry
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library