Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Different font rendering between paint devices (QPicture, QPrinter)
Forum Update on Monday, May 27th 2025

Different font rendering between paint devices (QPicture, QPrinter)

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.9k Views
  • 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 Offline
    W Offline
    wesulaner
    wrote on last edited by
    #1

    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
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved