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

Font hinting causing incorrect letter spacing in Qt WebKit

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • P3: Somewhat important
    • None
    • 5.4.0
    • WebKit
    • None
    • Linux, 64 bit Qt 5.4.0 (Arch package)

    Description

      Currently in createFontCustomPlatformData() in FontCustomPlatformDataQt.cpp the QRawFont is created with QFont::PreferDefaultHinting. This is hardcoded with no way to change it.

      This causes very poor letter spacing at some font sizes for some fonts (depending on how much hinting information the font has). See attached screenshot for text rendered in DejaVu Sans at 14px and 15px. Note the incorrect spacing around the u character at 15px (the first word)

      This is a particular problem when using QWebView to render to a non-screen device, such as a PDF file, where there really should be no hinting. Hinting is the responsibility of the PDF viewing app, not the PDF creating app.

      There should be some way to change this setting to no hinting. Ideally via QWebSettings, but I'd settle for even a environment variable.

      I realize that on windows with the GDI font backend hinting is unavoidable, but hopefully at some point in the future, Qt will switch to either DirectWrite or FreeType on windows.

      I know that on linux hinting can be turned off via fontconfig, but that is global (affects all applications).

      So it would be great to have an option to turn off hinting on linux and windows.

      Thank You.

      Attachments

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

        Activity

          People

            annulen Konstantin Tokarev
            kovid Kovid Goyal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes