Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QFontMetricsF::size only integer precision
Forum Updated to NodeBB v4.3 + New Features

QFontMetricsF::size only integer precision

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 330 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    poncho524
    wrote on last edited by
    #1

    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??

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      1
      • P Offline
        P Offline
        poncho524
        wrote on last edited by
        #3

        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?

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved