Text wrap control in printing

SyntaxEditor for WPF Forum

Posted 8 years ago by James Zheng
Version: 16.1.0631
Avatar

Hi Actipro,

I'm implementing printing feature for an Actipro syntax editor in my application and encounter an issue with line wrapping. I understand that it follows the standard line breaking rules for normal text passages.

However, my editor is more like a programming editor, such as the visual studio editor, where users don't place whitespaces between tokens sometimes. When this happens, the wrapped lines don't appear pleasing.  You'll see that user don't enter any whitespace, and the 1st line ends just before '('.

MyFunction
(Argument1,Argument1,Argument1,10,1,Argument1,1000,Argument1,1000,Argument1,Argument1,100.0,100.0,%
Argument1,Argument1,Argument1,0,Argument1,0,0);

In visual studio, it's implemented differently. You'll see that comma is treated as a line breaking character, and the 1st line occupies almost the full page width.

MyFunction(Argument1,Argument1,Argument1,10,1,Argument1,1000,Argument1,1000,Argument1,Argument1,100.0,100.0,%Argument1
,Argument1,Argument1,0,Argument1,0,0);

Please help check if it's possible to follow visual studio?

I'm sorry that I've submitted a ticket for this topic on 14/04/2016, as it allows attaching of pictures. However, there was no response and I thought it's could be my ticket not submited properly.

Thanks and regards,

James Zheng

[Modified 8 years ago]

Comments (7)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi James,

I checked our ticket system and our support email spam folder but didn't see anything else from you.  Could you try emailing our support address with the screenshots you sent and reference this thread in your email?  Thanks!


Actipro Software Support

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi James,

Sorry but we still don’t see anything in our support email, even in the spam folder. Perhaps it’s being blocked on your end?  Could you upload your screenshots to a public OneDrive or other cloud drive and send us the link?


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

For the issue, please to the description I put in the forum. I’m attaching 2 screenshots in a seperate email to you, one for print in visual studio and the other for print in Actipro.

Regards,

James Zheng

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi James,

In the future, please don't reply to the forum post notification emails since those replies don't enter our support system.  Either sent it to the support address on our Contact Us page or manually create a support ticket.  Either should work fine.  We did find the emailed images though since we were looking through all the various email accounts for them.

Thank you for the images.  Unfortunately I don't think we can do anything here.  We use the WPF text formatting framework (TextFormatter, etc.) to render text, and we've never seen a way to control the logic it uses to determine soft break points in the line.  That logic unfortunately seems to be closed off from what we can control via options.  Sorry, I wish we could do more for you here but our hands are tied with what Microsoft provides.

[Modified 8 years ago]


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

Sorry for the trouble.

Is there any idea how visual studio achieve that? Or is there a way user can replace Actipro's use of TextFormatter with its own formater?

Regards,

James Zheng

Answer - Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi James,

No trouble at all... I'm not sure how VS achieves it.  I assume they are using the same TextFormatter since it's a core WPF thing.  But we haven't seen a way to control word wrapping and haven't found any docs on it on the web when searching for such a feature.  If you ever do come across something, please let us know.

We don't really want to write a custom formatter since the built-in one knows how to properly handle advanced things like bi-di text, etc.  Plus it would be a lot of extra work to write a custom one and other than this particular scenario, it has worked great for us thus far.


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

Thanks for the help. Keep in touch for the latest development on this.

Regards,

James Zheng

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.