The word-wrap provided by ^[&s0C is really a character wrap as you know. Note: I'm going to use ^[ to represent the escape character here.
The only idea I have ever had to do a real word wrap is to define each word in a macro then play back the macros: forward invisible, then backwards invisible, then forwards visible. e.g. "Happy daze" would become
^[&fyXHappy ^[&f1X^[*vo1T^[&f2X^[&a180P^[&f2X^[*v1oT^[&a0P^[&f2X^[&fyXdaze ^[&f1X^[*vo1T^[&f2X^[&a180P^[&f2X^[*v1oT^[&a0P^[&f2X
You could compress that a bit by having a macro that did the play back:
Then the text would be:
^[&fyXHappy ^[&f1x1y2X^[&fyXdaze ^[&f1x1y2X
The only advantage of this is that it doesn't matter what font size you print in. The printer will automatically wrap the text for you between the left and right margins. If you know how wide each character will be in advance (i.e. you know the font, and the width table for each letter in your string) then it would be much better to just insert a carriage return and line feed at the appropriate place.
Hey there - good idea! It's a real shame that PCL doesn't offer an automatic word-wrap, but I think this does offer the basis of the functionality.
However, I think there's one thing missing (it was needed with my printer anyway). You need to turn the line wrapping on (^[s0C) whenever you're typing forwards, but then turn it off (^[s1C) when you're writing backwards. Otherwise, after wrapping to the next line, the backwards writing will wrap you back onto the previous line again, and you're back where you started...
|file: /Techref/language/pcl/wordwrap.htm, 2KB, , updated: 2010/2/16 11:17, local time: 2018/3/19 13:51,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/language/pcl/wordwrap.htm"> PCL5 Word Wrap</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180319 RussellMc, Isaac M. Bavaresco, Sean Breheny, Neil, Van Horn, David, David C Brown, alan.b.pearce, Bob Blick, John Gardner, Brent Brown,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!