View Issue Details

IDProjectCategoryView StatusLast Update
0032260LazarusLCLpublic2017-08-14 12:22
ReporterPetr-K Assigned ToOndrej Pokorny  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
PlatformWindows 
Product Version1.9 (SVN) 
Summary0032260: Font in HintWindow on Hi DPI is too small
DescriptionIn THintWindow.Create
inherited TCustomDesignControl.Create sets Font.PixelsPerInch to 96
then Assignment
Font := Screen.HintFont
scales Font Height.

IMHO THintWindow is not designed then Font.PixelsPerInch should be same as Screen.PixelsPerInch

Patch is included.
Steps To ReproduceWindows with big fonts set 150% (144 DPI).
Screen.HintFont.Size := 7;
Displayed hint font is smaler than set in Screen.HintFont.
TagsNo tags attached.
Fixed in Revision55659
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Petr-K

2017-08-11 13:43

reporter  

hintwindow.patch (510 bytes)   
Index: lcl/include/hintwindow.inc
===================================================================
--- lcl/include/hintwindow.inc	(revision 55345)
+++ lcl/include/hintwindow.inc	(working copy)
@@ -32,6 +32,7 @@
   fCompStyle := csHintWindow;
   Parent := nil;
   Color := clInfoBk;
+  Font.PixelsPerInch := Screen.PixelsPerInch; //TCustomDesignControl.Create sets 96, Screen.HintFont is then scaled down on HiDPI
   Font := Screen.HintFont;
   Canvas.Brush.Style := bsClear;
   FAlignment := taLeftJustify;
hintwindow.patch (510 bytes)   

Ondrej Pokorny

2017-08-11 22:15

developer   ~0102139

Unfortunately it's not that easy - you have to take in mind that there can be different PPIs on different monitors.

I'll take a look.

Ondrej Pokorny

2017-08-12 14:06

developer   ~0102143

It works fine for me. Please upload a sample application to reproduce the problem.

Petr-K

2017-08-14 09:24

reporter  

hintapp.zip (1,169,647 bytes)

Petr-K

2017-08-14 09:39

reporter   ~0102161

Hintapp.zip uploaded.
Run project1.exe - Form Hint is smaller then Label1.Caption.
I use Windows 8 with big fonts set 150% (144 DPI).

If you place breakpoint on

constructor THintWindow.Create
Font := Screen.HintFont;

Font has 96DPI, Screen.HintFont has 144DPI and assignment scales font Height.

Ondrej Pokorny

2017-08-14 11:33

developer   ~0102162

You haven't set Application.Scaled := True. See http://wiki.lazarus.freepascal.org/High_DPI chapter "High DPI in Lazarus 1.8 and above".

Ondrej Pokorny

2017-08-14 12:21

developer   ~0102163

No, you were right. The hint font has to be scaled also for Application.Scaled=False. Fixed.

Petr-K

2017-08-14 12:22

reporter   ~0102164

In my app I scale everything myself. I missed this setting. Thanks.

Issue History

Date Modified Username Field Change
2017-08-11 13:43 Petr-K New Issue
2017-08-11 13:43 Petr-K File Added: hintwindow.patch
2017-08-11 22:15 Ondrej Pokorny Assigned To => Ondrej Pokorny
2017-08-11 22:15 Ondrej Pokorny Status new => assigned
2017-08-11 22:15 Ondrej Pokorny Note Added: 0102139
2017-08-12 14:06 Ondrej Pokorny LazTarget => -
2017-08-12 14:06 Ondrej Pokorny Note Added: 0102143
2017-08-12 14:06 Ondrej Pokorny Status assigned => feedback
2017-08-14 09:24 Petr-K File Added: hintapp.zip
2017-08-14 09:39 Petr-K Note Added: 0102161
2017-08-14 09:39 Petr-K Status feedback => assigned
2017-08-14 11:33 Ondrej Pokorny Note Added: 0102162
2017-08-14 11:33 Ondrej Pokorny Status assigned => resolved
2017-08-14 11:33 Ondrej Pokorny Resolution open => no change required
2017-08-14 12:21 Ondrej Pokorny Fixed in Revision => 55659
2017-08-14 12:21 Ondrej Pokorny Note Added: 0102163
2017-08-14 12:21 Ondrej Pokorny Resolution no change required => fixed
2017-08-14 12:22 Petr-K Note Added: 0102164
2017-08-14 12:22 Petr-K Status resolved => closed