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. Fonts on Mac vs Windows
Forum Updated to NodeBB v4.3 + New Features

Fonts on Mac vs Windows

Scheduled Pinned Locked Moved General and Desktop
4 Posts 3 Posters 2.9k Views 1 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.
  • B Offline
    B Offline
    babazaroni
    wrote on last edited by
    #1

    Hello,

    I've ported my app from Mac to Windows. We use Designer to lay out our ui elements. On Windows, I run through each widget at run time and reduce the fontsize by the dpi ratio of 72/96.

    For the most part, this does a good job where text length is not critical, but for some areas, the QLabels are too long and running into other widgets. It appears that the spacing between chars is different.

    I'm using verdana. Are their any fonts that are identical on both platforms? Commercial fonts would be ok.

    Our app requires precise placement of labels on a png background, so I've got to get the font size and spacing right.

    Thanks for your thoughts.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      miroslav
      wrote on last edited by
      #2

      Hi, this is going to be almost impossible to guarantee. Fonts are different in spacing between Mac and Windows, and even the same fonts are rendered differently at times. You can use heuristics to find a matching font (aka as trial-and-error), or use scalable backgrounds, for example SVGs, and scale according to the font.

      Mirko Boehm | mirko@kde.org | KDE e.V.
      FSFE Fellow
      Qt Certified Specialist

      1 Reply Last reply
      0
      • B Offline
        B Offline
        babazaroni
        wrote on last edited by
        #3

        Thanks, then I'll have to find another solution. The problems I was having were in areas that require right alignment. I'll specify right alignment, now, and not care if the left edge moves over a little.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vidar
          wrote on last edited by
          #4

          You could embed a font in your application's resource (if you got the font license to do that) and dynamically add the font ressource to the font database of the application. Maybe that helps to have the same look on windows and mac.

          ( see "http://developer.qt.nokia.com/doc/qt-4.8/qfontdatabase.html#addApplicationFontFromData":http://developer.qt.nokia.com/doc/qt-4.8/qfontdatabase.html#addApplicationFontFromData )

          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