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

Font rendering differs slightly across platforms with freetype engine

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Need More Info
    • Priority: P3: Somewhat important
    • Resolution: Incomplete
    • Affects Version/s: 5.14
    • Fix Version/s: None
    • Component/s: GUI: Font handling
    • Labels:
    • Platform/s:
      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
          macos.png
          106 kB
        2. overlay.png
          overlay.png
          73 kB
        3. simple-text-rendering.zip
          2.01 MB
        4. windows.png
          windows.png
          88 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            esabraha Eskil Abrahamsen Blomfeldt
            Reporter:
            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