Am besten ist m.E. nach, wenn der Anwender die Schriftgröße so vorgibt, wie er es gewohnt ist, z.B. mit 14.
Beispiel:
Delphi-Quellcode:
function GetFontHeight(FontSize, Zoom: integer): integer;
begin
Result := Round(FontSize / 0.0254 * Zoom / 100);
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
// MM_HIMETRIC: Each logical unit is mapped to 0.01 millimeter.
// Positive x is to the right; positive y is up.
SetMapMode(Canvas.Handle, MM_HIMETRIC);
Canvas.Font.Height := GetFontHeight(14, 50);
Canvas.TextOut(1000, -1000, '
Tach');
end;
Gruß
Thomas