10

I am writing a VCL/Delphi Application, and I need to draw text onto a Canvas object. I am having troubles though because I need the text to be at a variable size and angle. Is there any easy way of doing this? The TextOut method only takes arguments for the Starting Coordinates, so I dont know how i can get it to draw rotated text.
Thanks!

Ben313
  • 1,662
  • 3
  • 20
  • 32

1 Answers1

20

If you're drawing on a canvas, take a look at Canvas.Font.Orientation. It takes an angle as an integer in tenths of a degree. (ie. You pass 900 for a 90 degree angle.)

Mason Wheeler
  • 82,511
  • 50
  • 270
  • 477
  • 5
    Note that the Orientation property is not available in older Delphi versions. In those situations, you have to use the Win32 API CreateFontIndirect() function directly, and assign its result to the TFont.Handle property. – Remy Lebeau Jul 28 '10 at 19:35
  • Thanks for the caveat. Do you know what version Orientation was added in? – Mason Wheeler Jul 28 '10 at 19:49
  • 3
    It's not in D7, But is is D2006, not sure about D2005 – Gerry Coll Jul 29 '10 at 06:52