Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
QPainter drawFont() draws corrupt glyphs.
Manvis last edited by
I'm trying to overlay some 2d text over an OpenGL context using QPainter.
Here's the code I'm using to set up the font:
m_font = QFont ("Times", 15, QFont::Light, true);
Here's the code I'm using for drawing:
m_paintDevice = new QOpenGLPaintDevice;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
// OpenGL draw calls go here.
painter.drawText(m_defaultRect, Qt::AlignCenter, "This is a test.");
This is the result I'm getting:
I've tried multiple font families, yet this problem persisted. The only thing that can slightly mitigate it, is the increase in QFont size (60+ has little to none of these distortions).
I'm using Qt 5.2, on Windows 7, MinGW 32 bit, and would appreciate any help you can give.