Skip to content

Conversation

OregonGhost
Copy link

I'm currently trying to improve line-breaking within narrow tables and was therefore working on the basic line-breaking code (in PdfFlattenVisitor).

There was a problem with soft-hyphens which I believe come from a problem with the encoding of the source file, so I replaced the constant used in Migradoc with a Unicode code-point (instead of a Latin-1-encoded SHY character), and I replaced the code that would break on a soft-hyphen to use that constant, rather than repeating the SHY character. This will now work independent of the actual encoding of the source files. Note that in the diff, it looks like I've replaced an empty string with the constant, but it is actually the SHY character that was replaced :)

The actual addition, however, is added support for zero-width spaces. This should allow us to fulfill most of our line-break needs from outside (by injecting zero-width spaces at appropriate positions). Since the whole purpose of this character is breaking at that point if required, I figured it would be good non-breaking (pun intended) change to PdfSharpCore.

Florian Krabbenhoeft added 2 commits February 7, 2022 15:31
@ststeiger ststeiger merged commit ffe058f into ststeiger:master Feb 9, 2022
@ststeiger
Copy link
Owner

Merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants