Set Text Angle for a TFont instance

Lord Soth 0 Tallied Votes 233 Views Share

Note that the angle is in 1/10 of degrees. Any attempt to manipulate font.size or font.color will reset the angle to zero degrees.

procedure SetTextAngle(F:Tfont; angle: Word); 
var 
  LogRec: TLOGFONT;  
begin 
  GetObject(f.Handle,SizeOf(LogRec),Addr(LogRec)); 
  LogRec.lfEscapement := angle; 
  f.Handle := CreateFontIndirect(LogRec); 
end;
Vector Khanal 0 Newbie Poster

Do you know how to create a simple task manager ?
IF NOT CODE SNIPPET AS FOLLOWS;
uses
tlhlp32;

var
snap_process : PROCESSENTRY32;
snped : cardinal;
d : boolean;

procedure Tform1.button1click(sender : tobject);
begin
snap_process.dwsize := sizeof(processentry32);
snped := CreateTOolHelp32Snapshot(THCS32_SNAPPROCess,0);
d := Process32First(snped,d);
if d then
begin
listbox1.items.ad(snped.szexepath);
d := Process32Next(snped,d);
end;
end;

Snippet may contain errors check

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.