Permalink
Browse files

Issue #213: do not scale font two times, as this is done already some…

…where in the VCL
  • Loading branch information...
ansgarbecker committed Oct 25, 2018
1 parent 198b896 commit 0d7e459979e19f1cb197709e9c29687c4f08eddd
Showing with 7 additions and 9 deletions.
  1. +7 −9 source/apphelpers.pas
@@ -1749,12 +1749,16 @@ procedure InheritFont(AFont: TFont);
var
LogFont: TLogFont;
GUIFontName: String;
ScaledFontSize: Integer;
begin
// Set custom font if set, or default system font.
// In high-dpi mode, the font *size* is increased automatically somewhere in the VCL,
// caused by a form's .Scaled property. So we don't increase it here again.
// To test this, you really need to log off/on Windows!
GUIFontName := AppSettings.ReadString(asGUIFontName);
if not GUIFontName.IsEmpty then begin
// Apply user specified font
AFont.Name := GUIFontName;
// Set size on top of automatic dpi-increased size
AFont.Size := AppSettings.ReadInt(asGUIFontSize);
end else begin
// Apply system font. See issue #3204.
@@ -1771,14 +1775,8 @@ procedure InheritFont(AFont: TFont);
end;
end;
end;
// Increase font size for high dpi settings
ScaledFontSize := Round(AFont.Size * (MainForm.Monitor.PixelsPerInch / MainForm.PixelsPerInch));
if ScaledFontSize <> AFont.Size then begin
Mainform.LogSQL(f_('Scaling font size from %d to %d.', [AFont.Size, ScaledFontSize]), lcDebug);
AFont.Size := ScaledFontSize;
end;
end;
end;
function GetLightness(AColor: TColor): Byte;
var

0 comments on commit 0d7e459

Please sign in to comment.