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

Unexpected coloured fringes on QML text rendered in a layer



    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.7, 5.10.1
    • Fix Version/s: None
    • Labels:
    • 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.


      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).


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



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



                Gerrit Reviews

                There are no open Gerrit changes