Groups | Blog | Home
all groups > dotnet drawing api > may 2005 >

dotnet drawing api : Vertical Font Rendering


Phil Jones
5/5/2005 12:00:00 AM
Is there a way to render text from top-to-bottom (vertical) rather than
left-to-right?

I thought this was possible - but I can't see how.

Thanks anyone!
===
Phil

Bob Powell [MVP]
5/5/2005 12:00:00 AM
It's possible using interop and rendering the text using GDI but not in
GDI+.

You could output the text letter for letter manually by using
MeasureCharacterRanges to get the size of a character and placing it on some
central vertical line.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

James Westgate
5/5/2005 12:00:00 AM
I havent tried this but you could apply a rotate transform to a graphics
object and then use DrawString as normal. Best to use a Matrix object to set
up the transform first.

James

--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

Take the ERM Tour at http://www.flowchartcontrol.com

[quoted text, click to view]

Phil Jones
5/5/2005 12:00:00 AM
Hi Bob,

Thanks - that sounds a little more complex than the design problem demands.
I might have a look at the matrix idea that James just suggested though.

Many thanks - and I've got to say again how useful I find your FAQ site.
Very VERY helpful.

Cheers,
===
Phil

Phil Jones
5/5/2005 12:00:00 AM
Hi James,

Thats an interesting idea - I might have a look at that. I've got to get my
head around the transform objects at some point soon.

Thanks.
===
Phil

Bob Powell [MVP]
5/6/2005 12:00:00 AM
James' suggestion will render the whole string on its side not

l
i
k
e

t
h
i
s

Which is what I thought you wanted...

See the GDI+ FAQ for rotated text.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





[quoted text, click to view]

Phil Jones
5/6/2005 12:00:00 AM
Ah - I will do Bob.

I must have been searching on Font - not Text, which is why I didn't come up
with anything on your FAQ.

Again - appreciate all your help!
===
Phil

AddThis Social Bookmark Button