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

Unexpected coloured fringes on QML text rendered in a layer

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.7, 5.10.1
    • Fix Version/s: None
    • Labels:
      None
    • Environment:
      Stock Qt 5.7 and 5.10.1 installed via MaintainanceTool.  Debian jessie, NVidia GK208 GPU. (This is what the screenshots are from).

      Issue also observed on a mid-2012 MacBookPro and an early-2016 Mac Book.

      Description

      Ran into this while attempting to use the GraphicalEffects' DropShadow on Text.  However it seems to be independent of DropShadow and simply Text with layer.enabled can demonstrate it.  My ultimate objective is to have good looking drop shadowed text, so "so don't enable layer on Text" isn't a simple solution to this...

      Attached fringe.qml demonstrator code run in qmlscene produces screenshot

      which shows weird blue-looking fringes on the second text (which has layer.enabled on it). 

      shows the same thing on a grey background; originally I thought the effect was specific to coloured backgrounds, but closer inspection shows it's there too.

      For a closer look at both, there's

      .

      Tried qmlscene from both 5.7 and 5.10.1.  Also tried qmlscene multisample and software options... make no difference.  Tried various other layer options... e.g cached, smooth... made no difference.

      Perhaps surprising is that fringe-zoom.png shows hints of coloured fringing on the plain (unlayered) text on even the grey background.

      I'm guessing this is something to do with the surprisingly complex topic that is modern font-rendering... possibly related to attempting to take care of the sub-pixel layout of LCD pixel's RGB elements?  However, it seems to break down - or at least become unacceptably bad - when Text is rendered to a layer.  Not sure if this is actually a bug or just an unavoidable "by design"... if not fixable, sure would be nice to have a workround...

      Guessing this maybe related to QTBUG-28993

      Update/clarification: having read up a bit more on text rendering (and tried some things in the comments)... I should just clarify is that my issue isn't the coloured fringes on "vanilla" text.. I assume these are expected and due to LCD RGB "subpixel stuff"... and in fact I'd never noticed them until now.  What seems to be more of a problem is that they are somehow exaggerated when rendering Text with layer.enabled, to the point that the end-users do notice them (which is what got me looking at this).

        Attachments

        1. fringe.qml
          0.8 kB
        2. fringe-coloured.png
          fringe-coloured.png
          28 kB
        3. fringe-disable_distancefield.png
          fringe-disable_distancefield.png
          20 kB
        4. fringe-disable_distancefield-zoom.png
          fringe-disable_distancefield-zoom.png
          17 kB
        5. fringe-grey.png
          fringe-grey.png
          31 kB
        6. fringe-zoom.png
          fringe-zoom.png
          25 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            timday Tim Day
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes