[Interest] Font rendering problem in Qt5.3

C. Scharenberg scharenbergc001 at gmail.com
Thu Oct 30 16:32:39 CET 2014


Hello together,


when switching from Qt5.2.1 to Qt5.3.2, I observed problems with certain
fonts:
a) The glyphs look different. They are shorter and a bit wider than before.
b) When using point sizes between 37 and 48 (approximately), the glyphs
get rendered significantly below the intended position. This does only
apply if no scaling is used when painting.

I'm using Ubuntu 12.04 with a NVidia graphics adapter. My test
application is a Qt Widget application where some text gets rendered in
a specialized widget using QPainter::drawText(QRectF, int, QString,
QRectF*). I'm spcifying a rectangle based on the size reported by
QFontMetricsF::boundingRect(QString) and disable clipping.

There are at least two fonts affected:
- "Impact" (i think it's from the "ttf-mscorefonts-installer" package)
- "Liberation Sans Narrow" (assumably from the "fonts-liberation" package)

Because the majority of the installed fonts render correctly, there must
be something in the fonts that does not work. Perhaps some deviation
from the standards. On the other hand, Qt5.2.1 renders these fonts as
expected. So there must be some change in Qt, which is not fully
backwards compatible.

Does anybody know what's going wrong here?


Kind regards
Christoph



More information about the Interest mailing list