diff --git a/lcl/include/font.inc b/lcl/include/font.inc index 6d622f2ec4..e667d4c215 100644 --- a/lcl/include/font.inc +++ b/lcl/include/font.inc @@ -771,7 +771,7 @@ begin try FreeHandle; inherited SetSize(AValue); - FHeight := - Round(AValue * FPixelsPerInch / 72); + FHeight := -MulDiv(AValue, FPixelsPerInch, 72); if IsFontNameXLogicalFontDesc(Name) then Name:=ClearXLFDHeight(Name); Changed; @@ -824,7 +824,7 @@ procedure TFont.SetHeight(Value: Integer); begin if FHeight=Value then exit; // set Size first. This will set FHeight to a rounded equivalent - Size := -Round(Value*72/FPixelsPerInch); + Size := -MulDiv(Value, 72, FPixelsPerInch); // store the real FHeight FHeight:=Value; end;