Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Different font rendering between paint devices (QPicture, QPrinter)

    General and Desktop
    1
    1
    1853
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      wesulaner last edited by

      How can I prompt QPainter to draw text on QPicture in the same way it do on a QPrinter device?

      Output in PDF when I draw first in a QPicture an play() then to a painter with QPrinter Device:

      !http://www.wesolutions.at/boards/picture.jpg!

      @
      m_painter->begin(m_picture);
      m_painter->setBrush(Qt::black);
      m_painter->setPen(Qt::black);
      m_painter->setFont(QFont("Arial", 9));
      m_painter->drawText(0,0, "In Alaska reichen die ältesten gesicherten menschlichen");
      m_painter->end();

      m_painter->begin(m_printer);
      m_picture->play(m_painter);
      m_painter->end();
      @

      And this is the Output when I draw directily to a QPainter with a QPrinter:

      !http://www.wesolutions.at/boards/printer.jpg!

      @
      m_painter->begin(m_printer);
      m_painter->setBrush(Qt::black);
      m_painter->setPen(Qt::black);
      m_painter->setFont(QFont("Arial", 9));
      m_painter->drawText(0,0, "In Alaska reichen die ältesten gesicherten menschlichen");
      m_painter->end();
      @

      I’ll need paint first on Picture for a couple reasons.

      Thank you in advance!
      wesu

      1 Reply Last reply Reply Quote 0
      • First post
        Last post