Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-78982

Font rendering differs slightly across platforms with freetype engine

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P3: Somewhat important
    • None
    • 5.14
    • GUI: Font handling
    • None
    • Linux/X11, macOS, Windows

    Description

      Hello,
      Given :

      • Qt built with freetype
      • The same font file used
      • Font size set in pixels
      • No retina / highdpi feature (100% zoom on windows and no scaling on macos)

      There are still slight differences in font rendering, which cause text wrapping to occur differently depending on the platform.
      I've tried to pinpoint what changes by printing the most relevant font metrics, but they seem to be the same in both systems.
      Attached : screenshots of the test app on macOS & windows, as well as the source code I used.
      The test app draws the same text in slightly wider boxes.
      On windows, word wrap stops occuring at w=282, while on macOS, word wrap stops occuring at w=285 which prevents having the same text layout on both platforms in general, given a same-sized box.

      Attachments

        1. macos.png
          106 kB
          Jean-Michaël Celerier
        2. overlay.png
          73 kB
          Jean-Michaël Celerier
        3. simple-text-rendering.zip
          2.01 MB
          Jean-Michaël Celerier
        4. windows.png
          88 kB
          Jean-Michaël Celerier
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            jcelerier Jean-Michaël Celerier
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes