Bug 102356

Summary: Arthur backend uses incorrect miter join style
Product: poppler Reporter: oliver.sander
Component: arthur backendAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: oliver.sander
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: pdf file to trigger the bug
The file as rendered by the Splash backend
The file as rendered by the Arthur backend
Patch to use the correct join style

Description oliver.sander 2017-08-22 09:38:06 UTC
Created attachment 133666 [details]
pdf file to trigger the bug

The Arthur render backend implements the 'Miter' line join style incorrectly.  You can see this with the attached test file.  It contains a polygon with two corners positioned such that the miter limit is exceeded.  The pdf standard requires that in such a case, the miter join is converted to a bevel join:

  http://www.verypdf.com/document/pdf-format-reference/pg_0217.htm

The Arthur backend, however, simply shortens the miter a little bit.  This results in the spike that can be seen on the screenshot.
Comment 1 oliver.sander 2017-08-22 09:38:46 UTC
Created attachment 133667 [details]
The file as rendered by the Splash backend
Comment 2 oliver.sander 2017-08-22 09:39:23 UTC
Created attachment 133668 [details]
The file as rendered by the Arthur backend
Comment 3 oliver.sander 2017-08-22 09:48:58 UTC
The fix is to use Qt::SvgMiterJoin instead of Qt::MiterJoin.  It is recommended in

  https://bugreports.qt.io/browse/QTBUG-52640

and does indeed fix the problem.  I'll attach a patch.
Comment 4 oliver.sander 2017-08-22 09:49:38 UTC
Created attachment 133669 [details] [review]
Patch to use the correct join style
Comment 5 Albert Astals Cid 2017-08-22 21:00:24 UTC
Pushed

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.