SPECIAL OFFER        Order and save right now!
20% off with the 729824315 dicscount code for Ultimate Pack and any another product for Delphi from Greatis Programming!

⤷ Get font width/height in pixels

This example gets Form.Font width and height. Use TextWidth and TextHeight methods of TCanvas type.

procedure TForm1.Button1Click(Sender: TObject);
begin
  Label1.Caption:='Width is '+
    IntToStr(Form1.Canvas.TextWidth(Edit1.Text))+
    ' pixels';
  Label2.Caption:='Height is '+
    IntToStr(Form1.Canvas.TextHeight(Edit1.Text))+
    ' pixels';;
end;
More for developers
Databases for Amazon Associates
Amazon Categories
Amazon Nodes