Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63570

Inconsistent font scaling in HiDPI versus mixed DPI configurations under X11

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.9.1
    • GUI: Font handling
    • None
    • Debian sid, packaged Qt 5.9.1, plain Xorg session with Awesome WM, no desktop environment. `xrandr` output for the mixed-DPI case is attached. In single-display mode, only eDP-1 is connected.

    Description

      I have a laptop with a HiDPI built-in display (15" 3200x1800, 235 physical DPI), which I use both standalone and in a mixed-DPI environment (with one or two other monitors with 96 physical DPI), and I am trying to configure my system in such a way that it works correctly out of the box in both configuration, even when dynamically (i.e. without restarting X11) switching between the two.

      I have found that `QT_AUTO_SCREEN_SCALE_FACTOR=1` or the equivalent `Application::setAttribute(Qt::AA_EnableHighDpiScaling, true);` takes me a long way towards this, with the exception of font rendering.

      Specifically, with HiDPI support enabled (either via the environment variable or via the setAttribute above), the situation is the following:

      • when in a mixed DPI configuration, I get the correct (and expected) behavior with font DPI configured to 96 (e.g. by `QT_FONT_DPI=96` or `xrandr -dpi 96`, which configures X11 to report a DPI of 96 via the core protocol): font sizing is consistent between the monitors, and normally sized on both the HiDPI and LoDPI monitors (see otter-autoscale-mixed-96* attachments);
      • when only the laptop display is active (i.e. single, HiDPI monitor), then the correct behavior is achieved with the font DPI configured to 192 (again, either by `QT_FONT_DPI` or by configuring X11 to report 192 DPI via the core protocol) (see otter-autoscale-hionly-192);

      Using a font DPI of 192 in the mixed case gives too large fonts (consistently across Hi and LoDPI monitors, see otter-autoscale-mixed-192-* attachments), while using a font DPI of 96 in the single-display case gives too small fonts (see otter-autoscale-hionly-96).

      Attachments

        1. otter-autoscale-hionly-192.png
          877 kB
          Giuseppe Bilotta
        2. otter-autoscale-hionly-96.png
          898 kB
          Giuseppe Bilotta
        3. otter-autoscale-mixed-192-hi.png
          828 kB
          Giuseppe Bilotta
        4. otter-autoscale-mixed-192-lo.png
          282 kB
          Giuseppe Bilotta
        5. otter-autoscale-mixed-96-hi.png
          845 kB
          Giuseppe Bilotta
        6. otter-autoscale-mixed-96-lo.png
          286 kB
          Giuseppe Bilotta
        7. xrandr-mixed.log
          2 kB
          Giuseppe Bilotta
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            gbilotta Giuseppe Bilotta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes