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

Drawing text with 'QFont::PreferNoHinting' didn't work properly if the painter is rotated or the font is italic

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.0
    • 4.8.0
    • None
    • Windows Vista SP2 , Windows 7, compile Qt with DirectWrite enabled
    • f54c5d9133d7aa7636988db36fa6cc51d26434b6

    Description

      In the Qt affine demo in funtion 'XFormView::drawTextType(QPainter *painter)' set

      f.setHintingPreference(QFont::PreferNoHinting)'

      replace

      painter->fillPath(path, Qt::black);

      with

      painter->setFont(f);
      painter->drawText(0.0 , 0.0, m_text);

      Start the demo, switch to text type, scale the text down and rotate the text.
      At some rotating degrees and scaling factors the glyhs are clipped, at some rotating degrees nothing is drawn.

      It seemed to be that the function 'QFontEngineDirectWrite::imageForGlyph' in 'QFontEngineDirectWrite.cpp' didn't work properly if
      the transformation matrix 'xform' is rotated. The glyphs in the returned image are shifted out of bounds.

      At some font sizes or if the font is italic the right of the glyphs is clipped even if the painter is not rotated.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            niels Niels Franksen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes