I have some trouble to print Unicode characters with QPrinter and QPainter, especially Russian and Arabian.
To print out, I use nothing special:
bool TWinPrinter::printStr(TDeviceIO*, const QString& str) {
m_Painter.drawText(m_X, m_Y, str);
m_X += fm.width(str);
return TRUE;
}
bool TWinPrinter::printStr(TDeviceIO*, const QString& str) {
QFontMetrics fm = m_Painter.fontMetrics();
m_Painter.drawText(m_X, m_Y, str);
m_X += fm.width(str);
return TRUE;
}
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?
Bookmarks