Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QPainter::drawText(QRectF ...) draws with very unequally spaces between the characters
Niagarer last edited by
When I use the font "Corbel" and draw a text like the following
QRectF testRectF = QRectF(QPointF1, QPointF2); painter->drawText(testRectF, Qt::AlignVCenter | Qt::AlignLeft, "some text");
I get really ugly results like the following
There is more space between the 'i' and the 'a' for example than between the words "counter" and "variable" (there is a actual space between them, not between the 'i' and the 'a'). So, the spaces between the characters are very unequally.
When I use the font Arial, it is better, but still wrong, so it's not the font itself.
Has anyone an idea what the problem could be?
IIRC, you need to use a monospaced font for that kind of use case.
Hope it helps