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

QT5 apps don't obey normal Linux fontconfig rules

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.5.0
    • GUI: Font handling
    • None

    Description

      Hello, I have some QT5 apps running on Manjaro Linux, which is derived from Arch Linux. All GTK2 and GTK3 apps have excellent font rendering in the Cinnamon desktop environment I'm using, and QT4 apps also obey the GTK font rendering settings. However, QT5 apps look terrible, especially when using the Ubuntu family fonts for the user interface. Hinting and subpixel rendering is wrong, and the DPI is also wrong. My /etc/fonts/conf.d is Arch standard, which produces excellent results in everything except QT5 apps.

      I was able to fix the wrong hinting and subpixel rendering issues with the following /etc/fonts/local.conf file,

      <?xml version="1.0"?>
      <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
      
      <fontconfig>
      
      <match target="pattern">
        <edit mode="assign" name="dpi">
          <double>115.19921875</double>
        </edit>
      </match>
      
      <match target="font">
        <edit name="autohint" mode="assign">
          <bool>true</bool>
        </edit>
        <edit name="hinting" mode="assign">
          <bool>true</bool>
        </edit>
        <edit mode="assign" name="hintstyle">
          <const>hintslight</const>
        </edit>
        <edit mode="assign" name="lcdfilter">
         <const>lcddefault</const>
        </edit>
      </match>
      
      </fontconfig>
      

      The /etc/fonts/local.conf file is deprecated and should not need to exist if the /etc/fonts/conf.d and desktop environment font settings are correctly configured, which it is.

      Additionally, the above DPI setting doesn't work. (In my Cinnamon desktop settings I set DPI to 120% due to my hi-res screen, and the resulting DPI that xrdb -query reports is 115.19921875). So fonts are squinty and small on QT5 apps. The only way I can work around the DPI issue on QT5 apps is with xrandr --dpi 115. This also should not be necessary.

      Please make QT5 apps obey standard desktop fontconfig settings.

      I'll attach screenshots.

      Attachments

        1. GTK-font-settings.png
          83 kB
          Sam
        2. QT5_no-DPI-fix_no-local-conf.png
          94 kB
          Sam
        3. QT5_no-DPI-fix_with-local-conf.png
          97 kB
          Sam
        4. QT5_with-DPI-fix_with-local-conf.png
          121 kB
          Sam
        5. Qt5vsQt4.png
          69 kB
          Maciej Mrozowski

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              sb56637 Sam
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes