Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When a single word doesn't fit in a paragraph there will be no Linebreak #3

Open
groege opened this issue Feb 21, 2017 · 3 comments
Open

Comments

@groege
Copy link
Owner

groege commented Feb 21, 2017

Linebreak currently only works on Spaces, Hyphens and Soft-Hyphens.
If there aren't any of those characters the word should still be fit into the width.

@Wetzel402
Copy link

Wetzel402 commented Apr 19, 2017

I ran into a similar issue with the original PdfSharp. I'm not sure if you are working with the same problem or not but word wrapping does not work with gfx.drawstring. Instead XTextFormatter needs to be used.

//need xtextformatter for word wrapping
var tf = new XTextFormatter(gfx);
rect = new XRect(25, 150, 570, 50);
gfx.DrawRectangle(xpen, rect);
format.LineAlignment = XLineAlignment.Near;
tf.DrawString("Lengthy text that needs to wrap...", tinos, brush, rect, format);

@groege
Copy link
Owner Author

groege commented Apr 20, 2017

Thank you for the tipp :)
I'll have to look into using XTextFormatter in MigraDoc rather than gfx.drawstring

@Wetzel402
Copy link

I created a test project based on my original .Net 4.5 project using your PdfSharp port and have text wrapping working. You can have a look here.

https://github.com/Wetzel402/PdfSharpCore_TestApp

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

No branches or pull requests

2 participants