Results 1 to 3 of 3

Thread: Printing Unicode?

  1. #1
    Join Date
    May 2009
    Posts
    61
    Thanks
    5
    Thanked 6 Times in 6 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Printing Unicode?

    I have some trouble to print Unicode characters with QPrinter and QPainter, especially Russian and Arabian.
    To print out, I use nothing special:
    Qt Code:
    1. bool TWinPrinter::printStr(TDeviceIO*, const QString& str) {
    2. QFontMetrics fm = m_Painter.fontMetrics();
    3. m_Painter.drawText(m_X, m_Y, str);
    4. m_X += fm.width(str);
    5. return TRUE;
    6. }
    To copy to clipboard, switch view to plain text mode 
    When I print ascii texts, it works - of course. But UTF16 chars are not printed. I also played around with setting a printer font, without success. Do I miss something? How can I print out unicode texts to a QPrinter?

  2. #2
    Join Date
    May 2009
    Posts
    61
    Thanks
    5
    Thanked 6 Times in 6 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Solved: Printing Unicode?

    Was a problem with QString and QChar. Sorry.

  3. #3
    Join Date
    May 2009
    Posts
    61
    Thanks
    5
    Thanked 6 Times in 6 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Printing Unicode?

    I still have an error with Arabian/Persion characters and QPrinter and/or QPainter. When I have a line containing one arabian character, the line is printed from right to left - but english characters, too. It looks something like

    Name (Count) Description
    Dream (5) Something to talk about
    <some arabian description> )6( Nightmare

    Is this a known issue of qt3 (I am using qt3.38)?

Similar Threads

  1. Printing txt file vs Printing pdf file
    By rmagro in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2012, 15:45
  2. Qt4 poor printing performance
    By seneca in forum Qt Programming
    Replies: 4
    Last Post: 22nd January 2009, 14:23
  3. Replies: 3
    Last Post: 2nd July 2008, 03:00
  4. Printing problem in windows
    By joseph in forum Qt Programming
    Replies: 6
    Last Post: 12th July 2007, 08:04
  5. Replies: 0
    Last Post: 28th June 2006, 20:49

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.