PDFsharp & MigraDoc Foundation

MigraDoc: Invisible word-breaking characters
Page 1 of 1

Author:  RichardD [ Thu Nov 02, 2017 7:37 pm ]
Post subject:  MigraDoc: Invisible word-breaking characters

As mentioned back in 2010, in order to allow extremely long strings to wrap onto new lines, we have to insert "soft hyphens" at suitable points within the string.

Unfortunately, when the long string is an email address or URL, the hyphen completely changes the meaning of the text.

For example, the input www.pdfsharp.net could end up being displayed as:
|arp.net   |

which reads as www.pdfsh-arp.net - a completely different domain.

At the moment, the only way around this is to create a custom version of MigraDoc, and modify the ParagraphRenderer.RenderSoftHyphen method to not render the hyphen.

(This is made more difficult by the fact that the GitHub repository is consistently several months behind the NuGet packages. GitHub currently has beta 4a, whereas NuGet has 4c.)

It would be extremely useful to have an option to hide the soft hyphens, or to have an alternative invisible word-breaking character which we could use instead.

Author:  TH-Soft [ Thu Nov 02, 2017 10:17 pm ]
Post subject:  Re: MigraDoc: Invisible word-breaking characters


There is a pull request on GitHub that adds support for zero width non-joiner spaces. This pull request will most likely be included with the next beta version and will allow you to add invisible breaking spaces to any string.

Until then you will need a custom version.

Author:  RichardD [ Fri Nov 03, 2017 3:51 pm ]
Post subject:  Re: MigraDoc: Invisible word-breaking characters

Excellent news, thanks! :D

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group