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

Incorrect handling of Xft X resource settings

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.15.5
    • GUI: Font handling
    • None
    • Linux/X11

    Description

      Sorry, I haven't tested versions of Qt higher than Qt5, so I'm unaware as to whether this covers current versions of the software. I'm also not personally willing to test earlier versions of Qt myself. I'd assume that this bug has affected Qt for as long as it's had Xft support.

      https://www.freedesktop.org/wiki/Specifications/XSettingsRegistry/
      FreeDesktop's official resource on the X Resources for their software specify that for Xft/X FreeType, several settings should use "-1", "0", or "1" to specify their behaviour. In my experience, Qt5 only understands the values "true" and "false", at least in the case of Xft.antialias and Xft.hinting. This has a surprisingly disasterous affect.

      When Qt compares the antialiasing and hinting settings between FontConfig's configuration, and between X Resources, it appears to load the X Resources second, giving them precedence. If it fails to interpret the X Resources (as Qt can't handle these settings in their valid form), then they are actually set back to their default value.
      For any user trying both avenues at once to disable font hinting or antialiasing, it will look like Qt is simply ignoring their font settings.

      To reproduce:
      1. Create a ~/.config/fontconfig/fonts.conf with the following settings inside (don't forget XML headers and stuff):
      <match target="font">
      <edit mode="assign" name="hinting">
      <bool>false</bool>
      </edit>
      <edit mode="assign" name="antialias">
      <bool>false</bool>
      </edit>
      </match>
      2. Create and merge (restart X if you're not sure how) an ~/.Xresources file with the following (valid) settings inside:
      Xft.hinting: 0
      Xft.antialias: 0
      3. Open a piece of Qt software, observe how fonts are (probably) currently both hinted and anti-aliased.
      4. (Optional), remove these settings from your Xresources and/or set them to the out-of-spec "false" rather than "0" to observe how they start working.

      My personal reccomendation would be to support the "-1", "0" and "1" settings, and then either discuss making "true" and "false" valid settings with FreeDesktop, or to slowly deprecate the "true" and "false" settings.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            houston a a
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes