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

Font hinting doesn't work with HiDPI scaling (X11)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 5.10.1
    • GUI: Font handling
    • None

    Description

      In Linux/X11, most systems have font hinting enabled (using fontconfig) for much better font rendering (less blurring).

      On HiDpi displays (e.g. dpi=192), if not using any QT_SCALE environment variables, all Qt applications render fonts at 192 dpi with hinting enabled, so font rendering looks good. However, most (all) applications have rendering issues because the sizes in Qt are specified in pixels. Especially at DPIs higher than 192 (my laptop has 288 DPI).

      For proper scaling Qt scaling environment variables are suggested (like QT_SCREEN_SCALE_FACTORS=2). This causes all applications to render their widget sizes nicely (just like at 96 dpi, but scaled), but, it has a major drawback - font hinting is completely disabled. Note that this is the default mode for many distributions.

      I'd love to use the scaling mode (otherwise my desktop is broken in most applications), but the absence of font hinting really hurts my eyes.

      I'm attaching to screenshots:

      1. QT_SCREEN_SCALE_FACTORS=2 kwrite (font hinting is disabled, fonts are blurry).

      2. kwrite at 192 dpi (font hinting is disabled, fonts look good).

      Attachments

        1. qt_unscaled_192dpi.png
          qt_unscaled_192dpi.png
          212 kB
        2. qt_scaled_2x.png
          qt_scaled_2x.png
          278 kB
        3. font_hinting_enabled.png
          font_hinting_enabled.png
          170 kB
        4. font_hinting_disabled.png
          font_hinting_disabled.png
          150 kB
        5. 4k_words.png
          4k_words.png
          55 kB
        6. 4k_hinting_grid.png
          4k_hinting_grid.png
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            alex_sh Alexander
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes