Qt
  1. Qt
  2. QTBUG-41590

Pale text rendering on Linux compared to Qt4

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: P2: Important P2: Important
    • Resolution: Done
    • Affects Version/s: 5.3.2
    • Fix Version/s: 5.4.1
    • Labels:
      None
    • Environment:

      Arch Linux x86_64, Qt 5.3.2

    • Commits:
      501c510cc3cb6215aed27af7599395480a049667

      Description

      I have pale text rendering in Linux with freetype2-infinality and custom FIR filter (INFINALITY_FT_FILTER_PARAMS="06 18 33 18 06"). This behaviour was introduces in the Qt5, the Qt4 is not affected. The screenshot is attached (Qt4 assistant and Qt5 assistant are shown side by side). I found that problem is related to the gamma tables. So I've made a hack, which fixes this issue by disabling the text gamma correction completely (patch is attached). Maybe someone knows, how to make a correct fix?

      1. disable-font-gamma-correction.patch
        0.9 kB
        Anton Kalmykov
      2. qt-5.3.2-xcb-gamma-tweaks.patch
        0.6 kB
        NiLuJe
      1. BlendingExamples.png
        870 kB
      2. qt-font-rendering.png
        204 kB

        Issue Links

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

          Activity

          Hide
          Allan Sandfeld Jensen added a comment -

          For the record, the issue was not closed with the change above, but https://codereview.qt-project.org/#/c/99504/ which only affects XCB. We may need to revisit the issue for freetype on other platforms since freetype LCD filters appears to do some amount of gamma-correction on their own. See also QTBUG-42564

          Show
          Allan Sandfeld Jensen added a comment - For the record, the issue was not closed with the change above, but https://codereview.qt-project.org/#/c/99504/ which only affects XCB. We may need to revisit the issue for freetype on other platforms since freetype LCD filters appears to do some amount of gamma-correction on their own. See also QTBUG-42564
          Hide
          octoploid added a comment -

          I think simply setting gamma to 1.0 on Linux is too naive.
          Freetype's new CFF engine uses stem-darkening by default.
          It is designed to be used with a gamma of 1.8.
          In fact I have build QT5 with FontSmoothingGamma set to 1.8 and
          the results are excellent for OpenType fonts (that use freetype's CFF engine).
          (see discussions on the FreeType mailing list archive ("gamma correction issues with FreeType")
          for more info)

          Unfortunately with gamma=1.8 TrueType Fonts will look too thin as observed in this bug.

          Show
          octoploid added a comment - I think simply setting gamma to 1.0 on Linux is too naive. Freetype's new CFF engine uses stem-darkening by default. It is designed to be used with a gamma of 1.8. In fact I have build QT5 with FontSmoothingGamma set to 1.8 and the results are excellent for OpenType fonts (that use freetype's CFF engine). (see discussions on the FreeType mailing list archive ("gamma correction issues with FreeType") for more info) Unfortunately with gamma=1.8 TrueType Fonts will look too thin as observed in this bug.
          Hide
          octoploid added a comment -

          png that shows the issue

          Show
          octoploid added a comment - png that shows the issue
          Hide
          Hrvoje Senjan added a comment -

          So freetype people now recommend gamma of 1.8
          http://www.freetype.org/

          Show
          Hrvoje Senjan added a comment - So freetype people now recommend gamma of 1.8 http://www.freetype.org/
          Hide
          Allan Sandfeld Jensen added a comment - - edited

          If you reed the freetype post closely, you will see that they still haven't enabled stem darkening which is needed to fix the issue in this bug-report. But they say they will add a switch later, which sounds like what we need.

          Show
          Allan Sandfeld Jensen added a comment - - edited If you reed the freetype post closely, you will see that they still haven't enabled stem darkening which is needed to fix the issue in this bug-report. But they say they will add a switch later, which sounds like what we need.

            People

            • Assignee:
              Allan Sandfeld Jensen
              Reporter:
              Anton Kalmykov
            • Votes:
              5 Vote for this issue
              Watchers:
              20 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes