Wrap Around Text printing to NWP device.

Discussion about printing issues and techniques.

Moderators: Susan Smith, admin, Gabriel

Post Reply
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

Wrap Around Text printing to NWP device.

Post by GomezL »

We have been working on creating some very advanced NWP reports, but I have been struggling with printing "Long Paragraphs" when using NWP.

We have a "Free Form Note", this is text that simply wraps around from line to line.

Wen using a fixed font, the report looks great, the text wraps properly, and there is a fairly even right margin.

When we switch to a proportional font, the same report looks very strange because each line wraps at a very different place on the paper. Has anyone worked a way to measure how much text can be printed based on the actual print size of the proportional text?

I know that we can for example use RTF documents and let the word processor perform the wrap, but I am looking to perform this in NWP.

Luis
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

I recall somebody, I think George, talking about this at the last conference. So maybe he can chime in here.

But I recall the strategy was to assign each letter in the alphabet a numeric value for skinny, normal, or wide (big boned).

Skinny Letters have a value of 1 and they're things like i,j,l, and so on.

Normal Letters have a value of 2 and they're things like "J,L,b,B,g,G,x,X", and so on.

Fat letters are worth 3, and are things like "W,w,M,m", and so on.

The routine adds up the weighted total to get the proportional width of the line, and then it uses that to calculate the proper location to split the text.

If you want I can show you an example of how to make a function like this, and if you post the piece of your source code responsible for wrapping text with fixed width fonts, i can show you how to convert it to use this function.

Gabriel
GomezL
Posts: 258
Joined: Wed Apr 29, 2009 5:51 am
Contact:

Post by GomezL »

That sounds like a reasonable solution.

It's not perfect because each font/printer is going to be a bit different, but it's pretty good!

IF anyone actually has a "Conversion Table", that would be great, if not, it can't be all that hard.

I can print out RPT$(CHR$(X),20) and then measure the # actual width, and crate a table.

As a wishlist item, that would be a great BR function, pass it a string, and a "Font Name", and it will return the output size.
[/img]
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

If you want to get fancy, each font has a table embedded in it that has the size parameters.
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Post by Gabriel »

As a wishlist item, that would be a great BR function, pass it a string, and a "Font Name", and it will return the output size.
If we're talking about wish lists here, it would be nice if BR could have an option to just do the word wrapping for you when you're dealing with proportional (or fixed width) fonts.

Gabriel
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

The "wish list" item would be nice. Short of that I started to write a function to try to justify lines in NWP using the 1 2 3 concept, but found it Soooo much easier to use RTF, particularly with being able to wrap lines within multiple cells that I stopped trying to create what already existed.

If you have a copy of my RTFLIB.dll you can use this functinality very easily. To wrap within cells you will need to use either Open Office or Word as the RTF reader. I have not found any other RTF reader that honors cells and tables.

FNGeorge
Susan Smith
Posts: 717
Joined: Sun Aug 10, 2008 4:24 am
Location: Southern California

Post by Susan Smith »

Although it doesn't do tables, Atlantis does word-wrapping in columns. I use it everyday at two of my clients for printing contracts and invoices where I have 3 columns of "legalese" that needs to be word-wrapped.

So perhaps for some situations, this would be enough. And best of all, thanks to David Blankenship, we were all given a free license for Atlantis at a previous BRG conference. So if you've been around for awhile and were at some of our conference before 2007 or so, you might look back at some of those CDs I used to burn for the conferences. It would have been on one of those and I THINK that the license information may have been printed in the back of accompanying conference manual. I'm not sure about the license info though. If someone wants me to look it up, just say so.

-- Susan
gtisdale
Posts: 218
Joined: Sun Jun 07, 2009 7:54 am
Location: Concord, Massachusetts
Contact:

Post by gtisdale »

Yes, Atlantis is a great word processor and I do use it for many things (Thank you David)

It does excellent word wrapping for the page and can also do columns. But, after you have had the ability to wrap text in cells within a table and have the headers appear "magically" at the top of the page on every page break you just can't go back.

It's like finding that there is peppermint icecream after only having beren exposed to vaanilla all your life (and I love vanilla ice cream), but put a scoop of peppermint in a vanilla flavored soda ----- mmmmm. That's text wrapping in a table!

FNGeorge
Post Reply