🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #659

Re: Troff or pscat ?

#659
From: Dick Dunn
Date: Thu, 06 Jul 1989 06:05
39 lines
2488 bytes
In article <2209@astroatc.UUCP>, ttl@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@ico.isc.com    uucp: {ncar,nbires}!ico!rcd     (303)449-2870
   ...Simpler is better.
Technical Details
Message-ID: <15900@vail.ICO.ISC.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!ico!vail!rcd
References: <2209@astroatc.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!cs.utexas.edu!ico!vail!rcd
From: rcd@ico.ISC.COM (Dick Dunn)
Newsgroups: comp.lang.postscript,comp.unix.wizards
Subject: Re: Troff or pscat ?
Summary: not a problem, but a feature!
Message-ID: <15900@vail.ICO.ISC.COM>
Date: 6 Jul 89 06:05:45 GMT
References: <2209@astroatc.UUCP>
Organization: Interactive Systems Corp, Boulder, CO
Lines: 39