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

Text Rendering produces different results for different PaintDevices ( QPixmap and QImage )

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P3: Somewhat important
    • None
    • 4.7.0, 5.1.1
    • GUI: Painting
    • None
    • Windows 7 64 bit

    Description

      I've attached the results. When using QImage as PaintDevice, no antialiasing or sub pixel rendering is performed.

      Here is the code
      You can just change the commented line to test with the other PaintDevice.

      QApplication app(argc, argv);
      
      QImage img( 128 , 32 , QImage::Format_ARGB32 );
      //	QPixmap img( 128 , 32 );
      QPainter p( &img );
      
      p.fillRect(0,0,128,32, Qt::white );
      
      QFont font( "Courier New" , 10 );
      QPen pen( QColor( 128 , 0 , 0 ) );
      
      p.setPen( pen );
      p.setFont( font );
      
      p.drawText(  18 , 18 , "Sample Text");
      
      img.save( "asdf.png" );
      

      Attachments

        1. qimage.png
          qimage.png
          0.4 kB
        2. qpixmap.png
          qpixmap.png
          0.8 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sletta Gunnar Sletta
            mserdarsanli Mustafa Serdar Şanlı
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes