Qt6: fixed calculating font height. issue #41026, issue #40960.

This commit is contained in:
zeljan1 2025-01-08 16:23:06 +01:00
parent 759c61f5e1
commit 832b61143a

View File

@ -3112,7 +3112,6 @@ var
ALogBrush: PLogBrush absolute Buf;
Dashes: TQRealArray;
i: integer;
PaintDevice: QPaintDeviceH;
{$ifdef VerboseQtWinAPI}
ObjType: string;
{$endif}
@ -3149,13 +3148,8 @@ begin
FillChar(ALogFont^, SizeOf(ALogFont^), 0);
if AFont.getPixelSize = -1 then
begin
PaintDevice := nil; // QWidget_to_QPaintDevice(QApplication_desktop);
if PaintDevice <> nil then
ALogFont^.lfHeight := MulDiv(AFont.getPointSize, QPaintDevice_logicalDpiX(PaintDevice), 72)
else
ALogFont^.lfHeight := AFont.getPointSize;
end else
ALogFont^.lfHeight := MulDiv(AFont.getPointSize, Screen.PixelsPerInch, 72)
else
ALogFont^.lfHeight := AFont.getPixelSize;
ALogFont^.lfEscapement := AFont.Angle;
ALogFont^.lfWeight := ConvertFontWeightToQtConst(AFont.getWeight);