unidoc / unipdf

Golang PDF library for creating and processing PDF files (pure go)
https://unidoc.io
Other
2.54k stars 250 forks source link

[BUG] Table cell text wrap seems to incorrectly calculate a line break and then overlaps the content with the next row. #347

Closed lilith-writes-code closed 4 years ago

lilith-writes-code commented 4 years ago

Description

It seems to be that when the content in a cell is 13 characters long and contains some kind of punctuation (,.; ) that the cell contents break/wrap on a space into what would be the next row, even if there is enough space. In addition, the wrapped text is overlapping with the following row. This was tested against commit #f60e313cdb75 from the development branch.

Expected Behavior

The content should probably not have wrapped in the first place, there seems to be enough space for it to fit, but if it does need to wrap, it should clear the next row instead of overlapping.

Attachments

Include a self-contained reproducible code snippet and PDF file that demonstrates the issue.

tableWrapIssue.zip

lilith-writes-code commented 4 years ago

ooh, shiny. Ready for me to verify locally? :)

gunnsth commented 4 years ago

@venison That would be great. It has been merged into development branch.

lilith-writes-code commented 4 years ago

Fixes all the cases I have locally. Awesome! Thanks!

gunnsth commented 4 years ago

Great!