procedure tform1.drawtext(s:string;rect:trect);
var i:integer;
sep:real;
offrect:integer;
begin
sep:=(rect.Right -rect.Left)/length(s);
canvas.FillRect(rect);
for i:=1 to length(s) do
begin
canvas.TextOut(rect.left+ round((i-1)*sep),rect.top+5,s);
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
var s:trect;
begin
s:=rect(100,100,200,200);
drawtext('iloveyou',s);
end;