Troff or pscat ?

Dick Dunn rcd at ico.ISC.COM
Thu Jul 6 16:05:45 AEST 1989


In article <2209 at astroatc.UUCP>, ttl at astroatc.UUCP (Tony Laundrie) writes:

[troff example input deleted; consider the PostScript output...]
> 2281(a)S
> 2330(test)S
> 2436(of)S
> 2508(the)S
> 2604(emergenc)S		<<<  How can I prevent this type of word separation
> 2839(y)S		<<<  from occuring?  Is it troff or pscat that is
> 2891(broadcast)S	     causing the problem?

It's not a problem.  Troff is positioning output as it believes it should.
Pscat is gathering the output and turning it into PostScript as best it
can.  When pscat finds that after one character is output, the new position
is the same as the explicit position of the next character, it combines the
two characters and outputs them with a single call (ultimately in a single
"show").  This collection goes on as long as the implicit motion from
character widths matches the explicit positioning of characters.  The
savings in the size of the PostScript file from this straightforward opti-
mization is enormous--note that the overhead per string is 8 bytes.

It is almost fortuitous (?!) that the coalescing usually joins words back
together--but this is by no means guaranteed.  For various reasons, not all
words get rejoined, nor should you expect them to be.  If you're trying to
find "words" in the pscat output, you're probably going at things in a very
wrong way--what you're seeing is only character sequences which were caught
by pscat's coalescing algorithm.  (The same thing will happen with psroff =
ditroff + psdit, although the circumstances are different.)  In particular,
any situation which causes troff to think the natural spacing of characters
should be different from PostScript font widths will cause the splitting
you see.  Possible factors (speaking generally) include pair kerning,
differing ideas of character widths in troff and the back end, and rounding
errors in width calculations.

If you need to find "words", look for them far upstream, in the input to
troff.
-- 
Dick Dunn     rcd at ico.isc.com    uucp: {ncar,nbires}!ico!rcd     (303)449-2870
   ...Simpler is better.



More information about the Comp.unix.wizards mailing list