Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QFontMetricsF::size only integer precision



  • I'm seeing an issue where the exact executable (and i'm pretty sure the exact libraries), on different systems is giving different results.

    I use QFontMetricsF::size to analyze and scale fonts. On one system the return value is a legit floating point. Same executable on another system QFontMetricsF::size returns integer-rounded values instead.

    What are the cases that QFontMetricsF::size would return integer-precision rounded values??


  • Lifetime Qt Champion

    Hi,

    What are the differences between the two machines where your run your application ?



  • Both machines are RHEL based. The one that works as expected is full desktop 7.6. The one that doesnt' work, is a stripped down RHEL 7.0.

    Both have the same QT libriares, both have the same version of libfreetype.

    I think its not that QFontMetricsF is lying, I think its telling the truth and that the font engine can't size fonts more granular than 1 pixel.

    What would cause that?
    I use QFont::setStretch() and expect that QFontMetricsF::size() would scale in relation... but it doesn't; it snaps to whole integers.

    What would cause this?


Log in to reply