## Main font in chm help is too small on 4K monitor 200% scaled Topic is solved

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Ronald
Super wx Problem Solver
Posts: 258
Joined: Mon Mar 05, 2018 4:17 am

### Main font in chm help is too small on 4K monitor 200% scaled

Monitor: 27'
Resolution: 4K
Scale: 200%
Screenshot:
doc.png (69.64 KiB) Viewed 4961 times
Only the font for the content are not scaled as expected.

When I tried to fix it, I encountered some problems:
• When run regen.sh, it require hhc.exe which is for Windows, does it mean I have to install wine & html help work shop?
• I don't where to change font in source for the content, I've read through docs/doxygen/extra_stylesheet.css, but could not find out the point.

PB
Part Of The Furniture
Posts: 3082
Joined: Sun Jan 03, 2010 5:45 pm

### Re: Main font in chm help is too small on 4K monitor 200% scaled

Did you try another CHM viewer as suggested in your other thread on the same topic?

If the size of the basic style tag such as <body> or <p> is not specified, I would guess the viewer uses some default of its own. Perhaps other viewers use some better default, taking high DPI into account?

As for modifying the actual help file: Did you try adding adding font-size for <body> or <p> to see if it changes anything? It seems that most styles in extra_stylesheet.css set font-size in per cents of the inherited value; however, few use size in pixels so those may need to be edited as well.

Ronald
Super wx Problem Solver
Posts: 258
Joined: Mon Mar 05, 2018 4:17 am

### Re: Main font in chm help is too small on 4K monitor 200% scaled

PB wrote:
Fri May 14, 2021 11:46 am
Did you try another CHM viewer as suggested in your other thread on the same topic?
No, I prefer the native one, and if it is fixed, it'll be convinient for others.
PB wrote:
Fri May 14, 2021 11:46 am
If the size of the basic style tag such as <body> or <p> is not specified, I would guess the viewer uses some default of its own. Perhaps other viewers use some better default, taking high DPI into account?

### Re: Main font in chm help is too small on 4K monitor 200% scaled

The main issue seems to be that the font sizes are given in pixels (px). In order to be resolution independent they should be defined in point (pt) (1 pt = 1/72th inch)
Use the source, Luke!

PB
Part Of The Furniture
Posts: 3082
Joined: Sun Jan 03, 2010 5:45 pm

### Re: Main font in chm help is too small on 4K monitor 200% scaled

I have only rudimentary knowledge of CSS, so I do understand why you chose change the style the way you did. But I suppose you know what you are doing.
Ronald wrote:
Fri May 14, 2021 1:47 pm
Yes, but only one css file can be assign to HTML_EXTRA_STYLESHEET.
The doxgen docs seems to imply otherwise? https://www.doxygen.nl/manual/config.ht ... stylesheet
Ronald wrote:
Fri May 14, 2021 1:47 pm
BTW, someone says it's a HiDPI bug of html help executable
As I said before, the viewer is seriously outdated, my first choice would be try to find an alternative.

Ronald
Super wx Problem Solver
Posts: 258
Joined: Mon Mar 05, 2018 4:17 am

### Re: Main font in chm help is too small on 4K monitor 200% scaled

Solved by fixing a bug of html help executable (c:\windows\hh.exe)

fix the manifest of hh.exe as below

The manifest file works:

hh.exe.manifest

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation -->
<assembly
xmlns="urn:schemas-microsoft-com:asm.v1"
xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"
manifestVersion="1.0"
>
<assemblyIdentity
version="5.1.0.0"
processorArchitecture="amd64"
name="Microsoft.Windows.Help.HH"
type="win32"
/>
<description>Microsoft HTML Help Executable</description>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="asInvoker"
uiAccess="false"
/>
</requestedPrivileges>
</security>
</trustInfo>
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">
<gdiScaling>true</gdiScaling>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

Patch it to hh.exe (needs administrator privilege for c:\windows\hh.exe)

Code: Select all

mt.exe -manifest "path\to\hh.exe.manifest" -outputresource:"path\to\hh.exe"

(mt.exe can be found in Visual Studio command line environment)
Last edited by Ronald on Fri May 14, 2021 2:40 pm, edited 2 times in total.

Ronald
Super wx Problem Solver
Posts: 258
Joined: Mon Mar 05, 2018 4:17 am

### Re: Main font in chm help is too small on 4K monitor 200% scaled

PB wrote:
Fri May 14, 2021 2:20 pm
As I said before, the viewer is seriously outdated, my first choice would be try to find an alternative.
doublemax wrote:
Fri May 14, 2021 2:16 pm
The main issue seems to be that the font sizes are given in pixels (px). In order to be resolution independent they should be defined in point (pt) (1 pt = 1/72th inch)
It's caused by a bug of manifest of html help executable (hh.exe), I've fixed it.

BTW, I have tried kchmviewer, it can control the font size properly, what's nice is it can remember the font size after restarting. The downside is it takes a long time to load a chm file (e.g. 5 seconds to load wx's chm help file).