nish
17th December 2007, 13:53
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
pos=QPoint(50,50);
//"Å’" != "CE"... its a charecter of telugu font with value 140.
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
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
pos=QPoint(50,50);
//"Å’" != "CE"... its a charecter of telugu font with value 140.
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