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

Text is always rendered at 72 DPI

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.5.3
    • GUI: Font handling
    • None
    • Debian testing, FreeType 2.3.11, Fontconfig 2.8.0

    Description

      Qt does not honor the configured DPI when rendering text. This causes text to be rendered incorrectly on screens with non-square pixels, even when the system is correctly configured and QX11Info::appDpiX()/QX11Info::appDpiY() report the correct values.

      The problem seems to be that the calls to FT_Set_Char_Size do not include the configured DPI of the screen. According to the FreeType documentation calls to FT_Set_Char_Size where both horizontal and vertical resolution values are zero, a value of 72 DPI will be used instead.

      The attached patch uses qt_defaultDpiX()/qt_defaultDpiY() in all calls to FT_Set_Char_Size instead of zero. With the patch applied and my screen configured at 54x72 DPI text looks normal.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            natanojl Jonatan Lindblad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes