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

Deprecate QPainter::TextAntialiasing

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9
    • GUI: Text handling
    • None
    • All

    Description

      QPainter::TextAntialiasing and its relation to QFont::NoAntialias is confusing. The documentation states "Indicates that the engine should antialias text if possible. To forcibly disable antialiasing for text, do not use this hint. Instead, set QFont::NoAntialias on your font's style strategy" but it does not say when to enable the flag.

      Looking at code where it's used, it is an optional opt-out in very specific cases. For instance, when the font size exceeds 64 pixels we will fall back to QPainterPath rendering in QPainter. Clearing the QPainter::TextAntialiasing flag will cause rendering to be aliased in this case, causing the text to go from smooth to chunky at a specific scale/size. This use case would be tricky to support with just the QFont::NoAntialias flag, but typically users will want antialiasing at large sizes and aliased rendering and small sizes, not the other way around. It also seems very arbitrary since it's decided by an implementation detail in the glyph cache logic.

      So proposal is to deprecate this and leave it working, but get it out of the docs so it doesn't confuse people

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            esabraha Eskil Abrahamsen Blomfeldt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes