Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.12.3
-
None
Description
The QFontMetrics*::height() function returns ascent() + descent(), which one would think will be more or less a height of a font. The problem is that at least on Linux with FreeType engine, descent() is negative, so ascent() + descent() doesn't mean much, and it's far from being height of the font.
I'm not sure what are origins of the change, but I'm pretty sure height() worked correctly before (in Qt 5.11 perhaps?), so that font.pixelSize() was more or less equal to QFontMetrics (font).height(). Unfortunately I can't downgrade my system now to check this without breaking all dependencies.
The fix would be to define height() as ascent() - descent(), or… perhaps to make sure that descent() returns positive numbers (since it's defined as distance after all).