How to display local language fonts in qpainter
Hi Guys,
am new to Qt4 my task is I trying to write different tamil fonts in postscript file , i can able write in tamil but i cannot select any fonts kindly help me
thanks in advance !!
My code :
QPrinter printer;
printer.setOutputFormat(QPrinter::PostScriptFormat );
printer.setOutputFileName("test.ps");
printer.setPaperSize(QPrinter::A4);
QPainter painter(&printer);
painter.drawLine(QPointF(0, 0), QPointF(72, 72));
painter.setPen(Qt::blue);
painter.drawText(10, 10,QString::fromUtf8("நனà¯à®±à® ¿"));
//painter.setFont(QFont(QString::fromUtf8("TAU_Elang o_Todi", 20));
painter.drawText(20, 20,"நனà¯à®±à®¿"));
painter.end();
Re: How to display local language fonts in qpainter
What do you "cannot select any fonts"? You never get the font to change? The font changes but is not the expected font? You get the correct font but only garbage out?
Your string literal is possibly being misinterpreted. It could be a local 8bit encoding (i.e. not a UTF8) or your compiler could be mangling it before it even gets to Qt.
Re: How to display local language fonts in qpainter