Results 1 to 5 of 5

Thread: QPainter::drawText() with TT font does not print on printer- HELP

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2007
    Location
    India
    Posts
    1,042
    Thanks
    8
    Thanked 133 Times in 128 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default QPainter::drawText() with TT font does not print on printer- HELP

    Hi there...
    I am ihaving problems in printing using a true type telugu language font..


    I have some code like this

    Qt Code:
    1. QString fontFamilyName="AnupamaMedium"; // Telugu Font (True Type)
    2. //fontFamilyName="Arial";
    3. font.setFamily(fontFamilyName);
    4. font.setPointSize(26);
    5.  
    6. QChar qchar=140;//decimal value of 'Å’'
    7. textToDraw=qchar;//shows as a square in debugger watch window
    8. textToDraw="Å’";//shows as a square in debugger watch window
    9. QByteArray barr="Å’";//This shows CORRECT in debugger watch window
    10. pos=QPoint(50,50);
    11. //"Å’" != "CE"... its a charecter of telugu font with value 140.
    To copy to clipboard, switch view to plain text mode 

    then QPainter::drawText(pos,textToDraw) is called in the paintEvent() and in
    the printing function. the charecter draws well in the paintevent but not on the printer.

    i think there is something to do with QString(or QTextCodec) here but i dont know what.

    There is no problem with the font,,, because the same character shows and prints in
    notepad.

    I am attaching the sample code... please have a look and help.
    thanks in advance.

    PS- the font file is included in the zip
    Attached Files Attached Files
    Last edited by jpn; 17th December 2007 at 19:10. Reason: missing [code] tags

Similar Threads

  1. Change font in QPainter::drawText
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 19th May 2006, 16:21

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.