Delphi tip: rotated text
The following code was tested in Embarcadero RAD Studio XE3.
procedure TForm1.Button1Click(Sender: TObject); var mylogfont: TLogFont; myfont: TFont; begin with Form1.Canvas do begin Font.Name := 'Arial'; Font.Size := 24; myfont := TFont.Create; try myfont.Assign(Font); GetObject(myfont.Handle, sizeof(mylogfont), @mylogfont); mylogfont.lfEscapement := 450; { angles are in tenths of a degree } mylogfont.lfOrientation := 450; { for common graphics orientation should be equal to escapement } myfont.Handle := CreateFontIndirect(mylogfont); Font.Assign(myfont); finally myfont.Free; end; TextOut(20, 150, 'Rotated Text!'); end; end;
This is the image it produces: