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

Glyphs with "style: Text.outline" get clipped below a certain font size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0
    • 5.1.0
    • Quick: SceneGraph
    • None
    • Windows 64 bit with 32 bit Qt@ANGLE
    • 24c72029d8af27e2a85d695b692d48cc9b4ea467

    Description

      At smaller font sizes text with outline looks really bad. Looking at a scaled up version it seems like the outline is clipped with a bounding rect that is too small. See attached image outline_stock.png and the three renditions of the same text at different scales.

      Doing some hacking in QSGDistanceFieldGlyphNode::updateGeometry() and changing line 216 from

      qreal maxTexMargin = m_glyph_cache->distanceFieldRadius() / 2;

      to

      qreal maxTexMargin = m_glyph_cache->distanceFieldRadius();

      results in better output as shown in outline_modified.png. For larger font sizes there is no difference as can be seen from the text at the bottom. The difference is especially noticeable with animated text in which case the stock text looks particularly horrible. Also attached the qml file for testing.

      The core problem seems to be that the outline must get thicker relative to the font size when going for smaller fonts but the margin gets capped at some point. I realize outlined fonts can never look good for extremely small fonts but I think there's some room for improvement. Small outlined fonts are also useful when scaled up if you want a thicker outline.

      Attachments

        1. main.qml
          1 kB
        2. outline_modified.png
          outline_modified.png
          23 kB
        3. outline_stock.png
          outline_stock.png
          21 kB

        Issue Links

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

          Activity

            People

              ylopes Yoann Lopes
              smphhh Samuli Holopainen
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes