Results 1 to 8 of 8

Thread: [RESOLVED] Graphics.RotateTransform for vertical aligned Text

Hybrid View

  1. #1
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    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

  2. #2

    Thread Starter
    Hyperactive Member nickwrs's Avatar
    Join Date
    Jan 2000
    Location
    Atlanta, Ga
    Posts
    398

    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

  3. #3
    PowerPoster boops boops's Avatar
    Join Date
    Nov 2008
    Location
    Holland/France
    Posts
    3,201

    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

  4. #4
    PowerPoster SJWhiteley's Avatar
    Join Date
    Feb 2009
    Location
    South of the Mason-Dixon Line
    Posts
    2,256

    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
  •  



Click Here to Expand Forum to Full Width