Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!icdoc!syma!leilabd From: leilabd@syma.sussex.ac.uk (Leila Burrell-Davis) Newsgroups: alt.sources.wanted Subject: Re: Nroff -> Epson FX Keywords: UNIX, or poss even PC Message-ID: <5141@syma.sussex.ac.uk> Date: 16 May 91 18:57:23 GMT References: <1991May14.192043.13244@g2.brispoly.ac.uk> Organization: Computing Service, University of Sussex, UK Lines: 48 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 and a real backspace character (ASCII 8) for . --snip-- # eps_ul - change from char backspace underline underlining to epson # escape sequences sed \ -e '/_\(.\)/s//-1\1-0/g' \ -e '/-0-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 '/\(.\)\1\1/s//\1\1/g' \ -e '/\(.\)\1\1/s//\1\1/g' \ -e '/\(.\)\1/s//E\1F/g' \ -e '/F\( *\)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)