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

Native font rendering distored with fractional scaling

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.8
    • GUI: Font handling
    • None
    • Linux/Wayland, Windows

    Description

      Run the following with a scale of 1.05

       

      import QtQuick 
      
      Item { 
         width: 200 
         height: 400 
      
      
         Text { 
             y: 310 
             text: "I might be misaligned" 
             renderType: Text.NativeRendering 
         } 

      The 310 is important, there's certain values that trip up.

      The result is:

      you can see some glyphs are positioned off.

      The relevant line causing this is in qsgdefaultglpyhnode_p.cpp

       

            qreal y = (qRound(glyphPosition.y() * glyphCacheScaleY) * glyphCacheInverseScaleY) -
                              (c.baseLineY * glyphCacheInverseScaleY) - scaledMargin;
      
      

      Drop the round here, and it "goes away" though obviously that's not the right fix.

      Attachments

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

        Activity

          People

            esabraha Eskil Abrahamsen Blomfeldt
            davidedmundson David Edmundson
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes