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

QTextDocumentLayout: Clipping issue when using selections

    XMLWordPrintable

Details

    • Bug
    • Resolution: Incomplete
    • P2: Important
    • None
    • 4.8.0
    • GUI: Text handling
    • Reproducible on the Desktop and on the MeeGo Harmattan device

    Description

      When using selections in QAbstractTextDocumentLayout::PaintContext the glyphs might get clipped wrongly on the left if the left-bearing of those characters is negative (e.g. when using Thai glyphs). The clipping is correct if no selection in QAbstractTextDocumentLayout::PaintContext is done.

      Attached is a Qt-only sample application that shows the issue.

      I've also attached a patch against the Qt-4.8 branch, but I'm not sure whether it is acceptable in regards to backward compatibility. I was confused that QTextLayout::draw() completely ignores the clipping if no selection is used but uses the quite restrictive clipping as soon as a selection is there.

      In libmeegotouch the general approach was that we use the margins/borders to avoid having clipped glyphs with bearings/accents, so one part of the patch in QTextDocumentLayout does not substract the document-margin anymore.

      Please let me know whether I should provide an "official" merge-request (with gerrit?) or whether the fix must be done completely different anyhow. Thanks.

      Attachments

        1. actual result.png
          actual result.png
          40 kB
        2. expected result.png
          expected result.png
          40 kB
        3. main.cpp
          1 kB
        4. 0001-Fixes-QTBUG-23717-QTextDocumentLayout-Clipping-issue.patch
          2 kB
        5. selection_error1.png
          selection_error1.png
          19 kB
        6. selection_error2.png
          selection_error2.png
          19 kB
        7. code.zip
          0.9 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            ppenz Peter Penz
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes