Jump to content

Export to PDF Miter bug on Stroke

Recommended Posts

Hi everybody,


I've built a simple 12pt black text with a 1pt white stroke applied to it and with miter join set to 1,41 (default value).

Exporting to PDF:

If I try to export to PDF, the result has problem with the stroke.

• I opened the PDF with Preview (Apple) and it seems that the stroke in some corners become a bevel and in other corners become a miter, apparently randomly.

• I opened the PDF with Adobe Illustrator, and the same problem shows up but in different places.

• I opened the PDF back with Affinity Designer and the problem is not there (uh?!).


I'm attaching a screenshot with AD, AI and Preview with annotation circles:

• problems annotated: post-10692-0-00616300-1439991449_thumb.png


I'm also attaching the original AD file "Cia.afdesign" and the exported PDF "Cia.pdf":




Thanks, JackSante


PS. Apart from bugs – Awesome job Affinity! ;)

Share this post

Link to post
Share on other sites

Thanks Chris_K.


Just a note: When Cia.pdf is opened in AI, the stroke's miter is 1,4 and not 1,41 as in AD.

In AI I've tried to change the the miter to 1,41 but it reverts back to 1,4; probably AI doesn't accept centesimal values.

Then I've set the miter to 1,5 and everything went well - corners are displayed as in AD.



Share this post

Link to post
Share on other sites

Whether the mitre logic kicks in depends on the angle of the corner.  1.414 (actually, the square root of 2) should give no bevel for right angles. With this text, the angle at the top-left of the 'i' is slightly more than 90 degrees, so it gets a bevel. This explains why some corners are affected and others aren't. It's not random, it's the angles.


The reason the join looks different is that we use a smarter algorithm to draw mitres that generally looks better, but which PDF doesn't support natively. You can think of the mitre limit as being a limit to how far the corner may extend. In Affinity, if the corner extends past that point, we bevel it at that point. This means that corners which are only just too sharp for a mitre get a very small bevel. In this case you can only see it on the 'i' if you zoom right in. Otherwise it looks like it hasn't bevelled at all. In PDF,  if a corner is too sharp for a mitre it becomes a flat bevel as if the mitre style hadn't been specified. This makes for a bigger bevel. It means a small change in corner angle can produce a big change in how the corner is drawn, which is why we don't like it.


In order to make the PDF look like Affinity, we would need to convert the stroke to curves. That would make the PDF bigger as vastly more points would be needed to represent even simple shapes. Our current policy is to only convert the stroke to curves if it is above a certain width. The 1pt outline is below that width. We figure when the line is so thin, the difference isn't very noticeable, as indeed it isn't in this case if you view at 100%. In the long run we plan to take the shape geometry into account when deciding whether to convert strokes to curves. Until then, this is a compromise we're stuck with.

Share this post

Link to post
Share on other sites


Thanks for the technical answer on the choices which stand behind that Affinity Designer behaviour.

Not being a pro, I think I'd read it twice to understand that "under the hood".


The strange fact is that AI and Preview OSX viewer react differently even for the same exported PDF. From an basic-user point of view all that seems pretty random. Of course is 'cause of angles and it's not random, but the standard user doesn't know which algorithm the PDF viewer/editor programmer decide to use; that means that the result is unpredictable anyhow.


And thanks for the workaround that you have suggested (convert to curves).

But can you tell me if the quick-dirty solution of putting a miter to 0,5 is a good one?



Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now