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

Qt renders text with different antialiasing algorithm(sometimes uses ClearType) on same font with different font size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.3.1
    • None
    • Windows

    Description

      Qt seems to render text with different antialiasing algorithms depending of font size. The problem is on windows platform only(Linux is ok).

      for example:
      Arial 48 is drawed with grayscale antialiasing algorithm.
      while
      Arial 47 is drawed with cleartype antialiasing algorithm.

      Solution should be:
      All text should be antialiased with grayscale method(just like it's in other platforms), unless explicitly specified otherwise.

      Here is code sample:

      void Widget::paintEvent(QPaintEvent * event)
      {
      Q_UNUSED(event);
      QPainter painter(this);
      painter.setFont(m_font);
      painter.setRenderHints(QPainter::Antialiasing | QPainter::TextAntialiasing);
      painter.drawText(10, 80, "Some text.");
      }

      where m_font can be set as:
      m_font = QFont("Arial", 47, 25);
      or
      m_font = QFont("Arial", 48, 25);

      I have attached small demo app that shows the problem, and printscreen of that app drawing text in Arial size 47, and size 48.

      Attachments

        1. font-render-issue.zip
          2 kB
        2. Mint-47.png
          Mint-47.png
          11 kB
        3. Mint-48.png
          Mint-48.png
          12 kB
        4. win7_Arial_47.png
          win7_Arial_47.png
          19 kB
        5. win7_Arial_48.png
          win7_Arial_48.png
          22 kB

        Issue Links

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

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              boris.barbulovski Boris Barbulovski
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes