Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.4.0, 4.4.1, 4.4.2, 4.4.3, 4.5.0, 4.5.1, 4.5.2, 4.5.3, 4.6.0, 4.6.1, 4.6.2, 4.7.0
-
None
-
Reproduced on Linux and Windows
-
1bdd2553b744de425b5952d2e9ab31753cd5b110
Description
When drawing the text of WebKit with "justify" alignment, the layout of the text can be wrong.
This seem to be happening mainly with non-latin-1 characters, greek in this example, a bug have also been reported for arabic.
#include <QtGui> class MyWidget : public QWidget { protected: void paintEvent(QPaintEvent *) { QPainter painter(this); painter.setFont(QFont("arial")); painter.drawText(QPointF(50, 50), QString::fromUtf8("Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei α Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei"), Qt::TextForceLeftToRight, 220); painter.drawText(QPointF(50, 100), QString::fromUtf8("Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei Bei"), Qt::TextForceLeftToRight, 220); painter.drawText(QPointF(50, 150), QString::fromUtf8(" Bei α Bei "), Qt::TextForceLeftToRight, 220); } }; int main(int argc, char **argv) { QApplication app(argc, argv); MyWidget m; m.show(); return app.exec(); }