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

Wrong miter limit output breaks PDF files

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.6.0
    • GUI: Painting
    • None

    Description

      Since https://codereview.qt-project.org/#/q/Ie93b0f4a56775729105a375ba3bcdb5b58993433,n,z (Qt 5.4), the PDF engine outputs miter limit for Qt::SvgMiterJoin and Qt::MiterJoin. The PDF miter limit concept is the SVG one, not the Qt one. For miter limiting to trigger on the same angle, Qt::MiterJoin miter limits need to be transformed by qSqrt(1.0 + miter_limit * miter_limit * 4).

      Even worse, while the PDF 1.4 spec claims that numeric values such as miter limits "are forced into valid range, if necessary", this is not the case with Adobe Reader DC. 0.5 is a valid value for a Qt::MiterJoin miter limit. But when it ends up in a PDF, it causes the file to be displayed with warnings and incompletely in Adobe Reader. It seems that the value needs to be at least 1.0 (i.e. one line width), which make sense given its interpretation, and which is ensured by above formula.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            dg0yt Kai Pastor
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes