Hi there...
I am ihaving problems in printing using a true type telugu language font..
I have some code like this
QString fontFamilyName
="AnupamaMedium";
// Telugu Font (True Type) //fontFamilyName="Arial";
font.setFamily(fontFamilyName);
font.setPointSize(26);
QChar qchar
=140;
//decimal value of 'Å’' textToDraw=qchar;//shows as a square in debugger watch window
textToDraw="Å’";//shows as a square in debugger watch window
QByteArray barr
="Å’";
//This shows CORRECT in debugger watch window //"Å’" != "CE"... its a charecter of telugu font with value 140.
QString fontFamilyName="AnupamaMedium"; // Telugu Font (True Type)
//fontFamilyName="Arial";
font.setFamily(fontFamilyName);
font.setPointSize(26);
QChar qchar=140;//decimal value of 'Å’'
textToDraw=qchar;//shows as a square in debugger watch window
textToDraw="Å’";//shows as a square in debugger watch window
QByteArray barr="Å’";//This shows CORRECT in debugger watch window
pos=QPoint(50,50);
//"Å’" != "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
Bookmarks