PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Tue Mar 19, 2024 2:41 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Nov 02, 2017 7:37 pm 
Offline

Joined: Thu Oct 16, 2008 1:54 pm
Posts: 14
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:
Code:
+----------+
|www.pdfsh-|
|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.


Top
 Profile  
Reply with quote  
PostPosted: Thu Nov 02, 2017 10:17 pm 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 905
Location: CCAA
Hi!

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.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Fri Nov 03, 2017 3:51 pm 
Offline

Joined: Thu Oct 16, 2008 1:54 pm
Posts: 14
Excellent news, thanks! :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group