Giving up on high DPI readiness - remove tweaks which mostly don't work as expected, and even differently on various computers. Instead, let Windows blur fonts.

This commit is contained in:
Ansgar Becker
2019-07-18 20:53:53 +02:00
parent 2ebbdc6ba3
commit c31cae2060
21 changed files with 50 additions and 85 deletions

View File

@ -15,7 +15,6 @@ type
public
constructor Create(AOwner: TComponent); override;
procedure AddSizeGrip;
function DpiScaleFactor(Form: TForm=nil): Double;
procedure InheritFont(AFont: TFont);
protected
procedure DoShow; override;
@ -64,12 +63,6 @@ begin
end;
function TExtForm.DpiScaleFactor(Form: TForm=nil): Double;
begin
Result := Monitor.PixelsPerInch / FPixelsPerInchOnDefaultMonitor;
end;
procedure TExtForm.InheritFont(AFont: TFont);
var
LogFont: TLogFont;
@ -84,12 +77,12 @@ begin
// Apply user specified font
AFont.Name := GUIFontName;
// Set size on top of automatic dpi-increased size
AFont.Size := Round(AppSettings.ReadInt(asGUIFontSize) * DpiScaleFactor);
AFont.Size := AppSettings.ReadInt(asGUIFontSize);
end else begin
// Apply system font. See issue #3204.
// Code taken from http://www.gerixsoft.com/blog/delphi/system-font
if SystemParametersInfo(SPI_GETICONTITLELOGFONT, SizeOf(TLogFont), @LogFont, 0) then begin
AFont.Height := Round(LogFont.lfHeight * DpiScaleFactor);
AFont.Height := LogFont.lfHeight;
AFont.Orientation := LogFont.lfOrientation;
AFont.Charset := TFontCharset(LogFont.lfCharSet);
AFont.Name := PChar(@LogFont.lfFaceName);