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

Mac does not render text correctly when painter scaled.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P3: Somewhat important
    • None
    • 4.5.3
    • GUI: Font handling
    • None
    • macOS

    Description

      It looks like some of the font instructions are being ignored.

      The issue can be reproduced with 10.5 and 10.6, but works as expected in windows.

       
      #include <QtGui>
      
      int main(int argc, char *argv[])
      {
          QApplication app(argc, argv);
          QGraphicsScene scene;
          QGraphicsView  view(&scene);
      
          QFont font;
          font.setFamily("Arial,sans-serif");
          font.setPointSize(11);
      
          QGraphicsTextItem *item = scene.addText("Test Set poSi D Hh", font);
          view.scale(6.0,6.0);
          view.setWindowTitle("Graphics Item - good");
          view.show();
      
      
          QTextDocument	docu2;
          docu2.setDefaultFont(font);
          docu2.setPlainText("\n\n\nTest Set poSi D Hh");
      
          QImage	 img2(QSize(1024, 1024), QImage::Format_ARGB32);
          QPainter	 imgPainter2(&img2);
      
          QTransform trans ;
          trans.scale(6.0,6.0);
          imgPainter2.setWorldTransform(trans);
      
          docu2.drawContents(&imgPainter2);
      
          imgPainter2.end();
          QLabel label2;
          label2.setPixmap(QPixmap::fromImage(img2));
          label2.setWindowTitle("Scaled image - not so good");
      
          label2.show();
      
          return app.exec();
      }
      
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            dettman Dean Dettman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes