|
-
May 12th, 2011, 07:08 PM
#1
Re: Graphics.RotateTransform for vertical aligned Text
You came too late with the VB version, but never mind, I braved the shark-infested waters of Csharp to take a look. TextRenderingHint.Antialias (without GridFit!) seems to give better diagonals and curves, but the straight lines become slightly irregular (on my screen). Sans-Serif fonts do better than Serif ones such as in your post above. Making the font slightly larger helps a lot -- 9 points is enough for Microsoft Sans Serif. I suspect that this is as good as you are going to get in WinForms. FWIW, WPF is reputed to be better at sub-pixel rendering. BB
Last edited by boops boops; May 12th, 2011 at 07:16 PM.
-
May 12th, 2011, 07:16 PM
#2
Thread Starter
Hyperactive Member
Re: Graphics.RotateTransform for vertical aligned Text
Thanks BB!
I think you have the right of it; I'm going to leave this open for a bit more to see if anyone else has any other insight.
I'll look into WPF.
- Nick
-
May 13th, 2011, 05:07 AM
#3
Re: Graphics.RotateTransform for vertical aligned Text
I can think of a couple of other possibilities that would be interesting to experiment with, although I don't have time at the moment,
1. Create a text path with GraphicsPath.AddString, rotate the path with its own matrix argument, then render the text with Graphics.Drawpath or Graphics.FillPath.
2. Render the text horizontally to a bitmap, then draw the bitmap rotated with Graphics.DrawImage.
3. Render the text to a bitmap at double the target size, then draw the bitmap reduced to the target size with Graphics.DrawImage.
I would be surprised if 1 offers much if any benefit, but I think 2 combined with 3 could well give an improved result for small text.
BB
Last edited by boops boops; May 13th, 2011 at 05:15 AM.
Reason: typos, as usual
-
May 13th, 2011, 10:52 AM
#4
Re: Graphics.RotateTransform for vertical aligned Text
I've not had much success with vertical rendering of text, not that I have done it much. However, my preference is to render text to an image and draw a rotated image. It seems to work for me, anyway, since I'm not a big fan of vertical text so don't do much of it.
"Ok, my response to that is pending a Google search" - Bucky Katt.
"There are two types of people in the world: Those who can extrapolate from incomplete data sets." - Unk.
"Before you can 'think outside the box' you need to understand where the box is."
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|