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

Text render antialiasing works only on some font sizes

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 5.3.1
    • None
    • Qt 5.3.1, Windows 7 64bit

    Description

      There is some problem drawing anti-aliasing text on windows platform(Linux is ok). The drawed text is antialiased only on some font sizes, ex. Arial 48 is drawed good(antialiased), while Arial 47 is aliased.

      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, in both Windows(with issue) and Linux(draws ok).

      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