Zeal: Support high-DPI screens

Created on 10 Feb 2014  路  17Comments  路  Source: zealdocs/zeal

When viewing documentation in zeal, I cannot figure out how to zoom the documentation in. When reading the same documentation in mozilla versus zeal, I notice that zeal is rendering text with the assumption that my display鈥檚 resolution is 96DPI.

When mozilla launches, it reads in the system-wide DPI value and automatically scales its UI and all HTML appropriately. (It would be nice if it supported Windows 8.1 per-monitor DPI, but only IE supports that so far; for now I just restrict my use of mozilla to the monitor that happens to match Windows鈥檚 calculated system-wide DPI value).

When zeal launches, it calls SetProcessDPIAware(). This function is not to be confused with the newer/better API SetProcessDpiAwareness(); calling SetProcessDPIAware() is equivalent to calling SetProcessDpiAwareness(Process_System_DPI_Aware). (Ideally, you/qt will eventually support calling SetProcessDpiAwareness(Process_Per_Monitor_DPI_Aware).) (I am just assuming your application is calling the said function because its behavior is consistent with calling SetProcessDPIAware() and I can find that this method is referenced in platforms/qwindowsdll.) This means that if the user鈥檚 system DPI reflects a very high DPI, such as from a high density monitor (mine is only semi-high density at 120DPI), the users would see text at half-size or smaller and be unable to read it. I mean, if the screen is high density, the user could always use a real-life magnifying glass (and still not be able to see the pixels, isn鈥檛 it awesome? :-D) and be able to read the text fine, but this would be quite inconvenient.

As a stop-gap measure, adding in C-+ and C-- zoom (copying more functionality from web browsers) and later fixing your code to support Qt鈥檚 DPI support (I really hope that Qt and its webkit control support DPI if it鈥檚 calling SetProcessDPIAware() on your behalf) is really the only way to go. Maybe someday Qt will add support for Windows 8.1 per-monitor/dynamic DPI and, by using Qt鈥檚 current DPI APIs, your app will automamagically work with that?

resolutiodone scopui typenhancement

Most helpful comment

The change committed requires Qt 5.6+ to work, our CI is currently building with Qt 5.5.1. I am working on fixing that.

All 17 comments

+1 for this one, my laptop's monitor is a 196 DPI one, and it can be quite tiring to read the docs at the original size.

If you cannot make the application DPI aware, a default zoom setting would be IMHO the best bet

1+, I have a 4k display on 13.3-inches and for me zeal is unusable. Running Ubuntu 15.04 btw.

It should be possible to enable high DPI support in Qt starting with version 5.4. There's an article about that in Qt documentation. I don't have a high DPI device, so I have no idea how I could test it. Setting QT_DEVICE_PIXEL_RATIO environment variable to auto or specific value theoretically should do the trick. If someone could test whether setting QT_DEVICE_PIXEL_RATIO=auto works, then I would hard code that in Zeal.

It's also possible to set the minimum font size for the embedded web view in the Zeal settings.

I can test that for you if you can provide me a compiled test version (Win 8 3200x1800 15.6")

@sidewinder94 CI builds should be the best option for testing.

Well the, i tested the latest stable build (zeal-stable-0.1.1-9-gfd4f3e2-windows-x86.zip)
The interface was really better.
The default font size for the browser is still too small but thanks to the appearance tab in the options, it can be set at any value.

I would say the problem is solved for windows users :)

I don't have a HiDPI Linux available at the moment.

Here is a screenshot of what it looks like (i set the font size at 24 in the options):
capture

(the only minor problem left is the tab size, which are way too small for the text size)

@sidewinder94 Thanks for testing. Did you use QT_DEVICE_PIXEL_RATIO=auto or it worked out of the box?

I do see a problem with the tab bar. Tab maximum width is fixed in pixels, so this requires a fix.

As per font size in the web view issue, it should be possible to set text default/minimum size or scaling based on actual DPI. Additional info in QTBUG-29571 and this SO answer.

@trollixx It worked out of the box.

My DPI scaling is set to 1.25 and I didn't have problems with Zeal 0.1.1 (was displaying just fine). After I downloaded 0.1.1-82-g8a8544f, it rendered the window in the same way (except for margin-left on the seach list view and see also icons; but fonts where the same) and setting QT_DEVICE_PIXEL_RATIO=auto didn't do anything different either.

Since it was fine for me before I just assume that this issue never existed for me, but I wanted to mention it anyway.

Edit: I would upload images but it doesn't work for some reason.

+1 I have the same problem, running Windows 8.1 with v0.1.1

Internal laptop screen 3200x1800 @ 13.3inch ( 276.05 PPI) its scaled 150%: but is is presented with 100%, so really tiny:
ppi276

its necessary to have the scaling dependent on the actual monitor. cos often external laptop screens have different DIP scaling.
This happens on my external scaled 100% screen (1920x1080 @ 24inch):
external

I wonder if anyone still experiencing any issues with Zeal on HiDPI screens? Qt should behave quite well nowadays.

Hi. Just discovered and installed Zeal to try out. I also have a display issue on Ubuntu 16.04 with my Dell XPS 13 9350 (3200x1800px with Unity scale set to 2x). I try upgrading to the updated version from the PPA but the issue remains.
capture du 2016-11-01 15-49-05
Changing minimal font size is enough for most docs but not all of them (jquery's is totally messed up for instance).

@kjaquier Starting zeal using the QT_DEVICE_PIXEL_RATIO=auto environment variable as described further up this thread addresses this issue

@robotlovesyou Thanks. I tried it and it works great.
Though, I had to use QT_DEVICE_PIXEL_RATIO=2 instead of auto, because for some reason auto makes everything too big.

The change committed requires Qt 5.6+ to work, our CI is currently building with Qt 5.5.1. I am working on fixing that.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cweiske picture cweiske  路  5Comments

Hibou57 picture Hibou57  路  7Comments

Stunkymonkey picture Stunkymonkey  路  7Comments

sheershoff picture sheershoff  路  4Comments

zoli picture zoli  路  8Comments