Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
5.1.1, 5.6.0 Beta
-
None
Description
I built Qt 5.1.1 from source on windows 7 using -directwrite and
when I set QFont::PreferNoHinting I get result as shown in attached picture.
Using QFont::PreferDefaultHinting or no -directwrite version gets correct picture (but with bad character positioning). And on final picture there is result I get on mac with and I want to get on windows with directwrite (nice smoothing and character positioning).
this simple program shows issue
#include <QtWidgets> class MyWidget : public QWidget { public: MyWidget() : QWidget(0) { } protected: void paintEvent(QPaintEvent * /*e*/) { QPainter p(this); p.translate(200,200); QFont font("Times"); // or any font font.setPointSize(12); font.setHintingPreference(QFont::PreferNoHinting); p.setFont(font); for (int i = 0; i < 36; ++i) { p.drawText(80, 0, "Just some text" ); p.rotate(10.0); } } }; int main(int argc, char **argv) { QApplication app(argc, argv); MyWidget widget; widget.resize(400, 400); widget.show(); return app.exec(); }