[alt.sources.wanted] Nroff -> Epson FX

bj_stedm@g2.brispoly.ac.uk (Bruce Stedman (Hagar)) (05/15/91)

Title says it all:

I would like something to go from nroff format to EPSON FX type printer
codes:
Ie -	use some ^L's for page breaks,
	use ^[E, ^[F for Bold
	similar for Italic/underline

Converting from nroff is all that is required, but something that worked
with the troff text-formatting commands (IE excluding pic etc.) would be
even better.

Ta,

BJS
-- 
------------------------------------------------------------------------
This article may be distributed freely, providing this message is in%#$:
------------------------------------------------------------------------

clewis@ferret.ocunix.on.ca (Chris Lewis) (05/17/91)

In article <1991May14.192043.13244@g2.brispoly.ac.uk> bj_stedm@g2.brispoly.ac.uk (Bruce Stedman (Hagar)) writes:
>Title says it all:
>
>I would like something to go from nroff format to EPSON FX type printer
>codes:
>Ie -	use some ^L's for page breaks,
>	use ^[E, ^[F for Bold
>	similar for Italic/underline

You want "nroff-driver" from the comp.sources.unix archives around 1988.
It's a facility to build "term" files to customize the output of nroff
for specific devices.

>Converting from nroff is all that is required, but something that worked
>with the troff text-formatting commands (IE excluding pic etc.) would be
>even better.

Well, there are two solutions: get groff, (a troff replacement), and use
its DVI output option to drive a DVI2Epson converter.  There *are* some around,
but I have no references.  The other solution is lend me your printer
and I'll get psroff to drive it.... ;-)  But either way, I think you'd
probably be pretty disappointed with the resolution.  If you get troff to
work, line drawing is trivial (groff would probably give you that).
-- 
Chris Lewis, Phone: (613) 832-0541, Domain: clewis@ferret.ocunix.on.ca
UUCP: ...!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request@eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!

leilabd@syma.sussex.ac.uk (Leila Burrell-Davis) (05/17/91)

bj_stedm@g2.brispoly.ac.uk (Bruce Stedman (Hagar)) writes:

> I would like something to go from nroff format to EPSON FX type printer
> codes:
> Ie -	use some ^L's for page breaks,
> 	use ^[E, ^[F for Bold
> 	similar for Italic/underline

Here are two little sed filters I use for turning nroff-style
backspacing and underlining to Epson equivalents. Before running
substitute a real escape character (ASCII 27) for <ESC> and a real
backspace character (ASCII 8) for <BS>.
--snip--
# eps_ul - change from char backspace underline underlining to epson
# escape sequences
sed \
    -e '/_<BS>\(.\)/s//<ESC>-1\1<ESC>-0/g' \
    -e '/<ESC>-0<ESC>-1/s///g' \
$*
--snip--
#
# epsbold
#
# Filter to turn nroff-style bolding (i.e. by backspacing and
# overstriking) into the escape sequences required for an Epson
# printer. See also nobold, which strips out the bolding, and
# no_ul and eps_ul which do the same for this method of
# underlining.
#
# Enhanced from the Poplog filter tpr_ul by Leila Burrell-Davis,
# 11th July 1990
#
sed \
    -e '/\(.\)<BS>\1<BS>\1/s//\1<BS>\1/g' \
    -e '/\(.\)<BS>\1<BS>\1/s//\1<BS>\1/g' \
    -e '/\(.\)<BS>\1/s//<ESC>E\1<ESC>F/g' \
    -e '/<ESC>F\( *\)<ESC>E/s//\1/g' \
$*
--snip--
You can extend this in various ways as required.

If you find a way of doing the ^L, I'd be interested.

Leila
-- 
Leila Burrell-Davis, Computing Service, University of Sussex, Brighton, UK
Tel:   +44 273 678390              Fax:   +44 273 678470
Email: leilabd@syma.sussex.ac.uk  (JANET: leilabd@uk.ac.sussex.syma)