Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
4.7.0, 5.11
-
None
-
Qt/X11
-
f7bbea791e6218de078016bd9e3b92453c6a491f (qt/tqtc-qtbase/6.2.1)
Description
Passing a font with capitalization() == QFont::SmallCaps to QPainterPath::addText() will create a path of same-size all-caps text.
It appears the glyphs are positioned with regard to QFont::SmallCaps, but they're all the same size.
test.cpp
#include <QtGui> class Test : public QWidget { Q_OBJECT public: void paintEvent(QPaintEvent*) { QPainter painter(this); painter.fillRect(rect(), Qt::white); QFont font("Arial", 40); font.setCapitalization(QFont::SmallCaps); QPainterPath path; path.addText(0, 60, font, "Hello Qt"); painter.strokePath(path, QPen(Qt::black)); } }; int main(int argc, char** argv) { QApplication app(argc, argv); Test t; t.resize(300, 200); t.show(); return app.exec(); } #include "test.moc"