v04i053: xtroff -- troff previewer for X11, Part08/18

Dan Heller argv at island.uu.net
Tue Jul 18 17:25:34 AEST 1989


Submitted-by: Mark Moraes <moraes at ai.toronto.edu>
Posting-number: Volume 4, Issue 53
Archive-name: xtroff/part08



#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#		"End of archive 8 (of 18)."
# Contents:  xtroff/Imakefile xtroff/XtStuff/Makefile
#   xtroff/fontstuff/ch2rst.c xtroff/fontstuff/scalech.c
#   xtroff/lint.out xtroff/suntroff.man xtroff/xfonts/adobe.awk
# Wrapped by moraes at neat.ai on Thu Jul 13 20:55:09 1989
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test -f 'xtroff/Imakefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/Imakefile'\"
else
echo shar: Extracting \"'xtroff/Imakefile'\" \(6533 characters\)
sed "s/^X//" >'xtroff/Imakefile' <<'END_OF_FILE'
X#
X#	Xtroff ImakeFile
X#
X#	make [all]	compiles the programs in this directory, and the
X#			relevant subdirectories - fontstuff are font
X#			manipulation programs, xfonts has the stuff for
X#			by piping the 75dpi bdf through awk scripts
X#			to remap it to PostScript collation sequences,
X#			and generating compressed snf.
X#	make install	makes and installs the programs
X#	make vfonts	makes and installs scaled and converted vfonts
X#			for the devsun device. Not strictly necessary, but
X#			useful for large fonts. xpic can use them too.
X#	make imfonts	Scales and converts Imagen RST fonts if you have them
X#			for the Imagen device. Good if you have them.
X#	make devsun	Installs the devsun width info and runs makedev
X#			Do this if you install the vfonts
X#	make devpsc	Installs the devpsc width info and runs makedev
X#			If you already have a devpsc device, from 
X#			Transcript(tm), or some other ditroff to
X#			PostScript(tm) translation package,
X#			then you probably don't need this.
X#
X#	Xtroff doesn't need (more important, doesn't use properly) the 
X#	devsun fonts, which are still here for the Suntools version.
X#	You may want to do a 'make vfonts devsun' if you use xpic, which
X#	can use those fonts too. (They are nice and large, for making slides)
X#
X#	The following two defines might need to be changed.  The VFONTS
X#	definition points towards the directory containing the Sun modified
X#	Berkeley versatec font catalog.  These bits of these fonts are used
X#	as the default screen font.  See the file fontstuff/MakeSunFonts for
X#	more details.
X#	
X#	The RSTFONTS definition points to the RST (Imagen) font
X#	files.  If you don't have an Imagen printer then you won't need to
X#	worry about these bits.  If you do have an Imagen printer then you
X#	may want to see the file fontstuff/MakeImagenFonts for a way of getting
X#	more accurate bits on the screen.  If you don't want to worry about
X#	the fonts (and I don't blame you) then xtroff will use the
X#	X fonts described above for.
X#
X#	The SUNTROFF_FONTS points to the directory where the fonts
X#	sit. It has subdirectories of the form 'dev'$DEVICE for each
X#	typesetter's fonts - devsun is the default for the scaled
X#	versatec fonts, devimp is for imagen, etc. 
X
X         VFONTS = /usr/lib/vfont
X       RSTFONTS = /usr/uturing/ron/rst
X SUNTROFF_FONTS = $(FONTDIR)/xtroff
X      RSTDEVICE = imp	#imagen
X      SUNDEVICE = sun	#versatec - other printers like lw.
X       WIDTHDIR = /local/share/troff
X        MAKEDEV = /local/src/v8troff/troff/makedev
X
X#	Percent MUST be two digits
X#	For the imagen, percent is 120 / 300, i.e 40. 
X     RSTPERCENT = 40
X
X#	For versatec fonts, which we use for laserwriters etc., 
X#	percent should be 120/200. i.e. 66. We use 50 for a better 
X#	error margin.
X     SUNPERCENT = 50
X
X#	For lots of debugging info, especially FONTDEBUG.
X#          DEBUG = -DFONTDEBUG -DWINDOWDEBUG -DTYPEDEBUG -DDEBUG
X          DEBUG =
X#    CDEBUGFLAGS = -g
X
X# 	defining -DNOADJUST excludes some experimental code which tries to 
X#	adjust character positions to make the X font match the troff 
X#	font more closely. It may look better if you don't define it - 
X#	ligatures, especially 'fi' come out wrong at present if it is
X#	undefined.
X# 	-DFASTARCS does not use an ellipse drawing algorithm that approximates
X# 	ellipses as polygons. Define it if your server draws arcs fast.
X#	(Leave it undefined on Suns, uVaxen, anything using the R3 sample
X#	server miarc.c code)
X#	-DBEZERKELYISM allows the parser to understand the ditroff
X#	sequences emitted by Berkeley ditroff. (May work, I don't have
X#	Berkeley ditroff to test it)
X# 	We have Menu/Menu.o, checkitem/CheckItem.o and menuitem/MenuItem.o 
X# 	installed as XtStuff - In fact, we keep all three (Menu. checkitem, 
X#	menuitem) in one directory to make matters simpler. 
X#	Window is adapted from the R2 version Chris Peterson's xman program.
X        DEFINES = -DFONTDIR=\"${WIDTHDIR}\" -DBITDIR=\"${SUNTROFF_FONTS}\" \
X		  $(DEBUG) -DNOADJUST
X
X       INCLUDES = -I./bitmaps -I./XtStuff -I$(TOP)
X        MATHLIB = -lm
X
X             FC = bdftosnf
X        XTSTUFF = XtStuff/libXtStuff.a
XLOCAL_LIBRARIES = $(XTSTUFF) $(XAWLIB) $(XMULIB) $(XTOOLLIB) $(XLIB)
X  SYSAUX_LIBRARIES = $(MATHLIB)
X           OBJS = xwindows.o suntroff.o parse.o font.o draw.o \
X		  fixpoint.o curves.o arc.o
X           SRCS = xwindows.c suntroff.c parse.c font.c draw.c \
X		  fixpoint.c curves.c arc.c
X       PROGRAMS = xtroff
X      PREVIEWER = xtroff
X
X.SUFFIXES: .manX .man
X
X.manX.man:
X	rm -f $*.man
X	sed -e 's?WIDTHDIR?$(WIDTHDIR)?g'\
X	    -e 's?FONTDIR?$(SUNTROFF_FONTS)?g' $*.manX > $*.man
X
X#define IHaveSubdirs
X#define PassCDebugFlags 'CDEBUGFLAGS=$(CDEBUGFLAGS)'
X
X# Comment out fontstuff and xfonts if you are compiling this on a crunch
X# machine which has no displays or X terminals attached.
X
XSUBDIRS = XtStuff fontstuff xfonts
X
XMakeSubdirs($(SUBDIRS))
XDependSubdirs($(SUBDIRS))
X
XComplexProgramTarget(xtroff)
X
XNamedMakeSubdirs(XtStuff/libXtStuff.a,XtStuff)
X
Xvfonts::
X		-mkdir $(SUNTROFF_FONTS)
X		cd fontstuff; make $(MFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" \
X			VFONTS=$(VFONTS) \
X			RSTFONTS=$(RSTFONTS) PREVIEWER=$(PREVIEWER) \
X			FC=$(FC) SUNPERCENT=$(SUNPERCENT) \
X			RSTPERCENT=$(RSTPERCENT) \
X			SUNTROFF_FONTS=$(SUNTROFF_FONTS) \
X			RSTDEVICE=dev$(RSTDEVICE) SUNDEVICE=dev$(SUNDEVICE) \
X			sunfonts
X
Ximfonts::
X		-mkdir $(SUNTROFF_FONTS)
X		cd fontstuff; make $(MFLAGS) CDEBUGFLAGS="$(CDEBUGFLAGS)" \
X			VFONTS=$(VFONTS) \
X			RSTFONTS=$(RSTFONTS) PREVIEWER=$(PREVIEWER) \
X			FC=$(FC) SUNPERCENT=$(SUNPERCENT) \
X			RSTPERCENT=$(RSTPERCENT) \
X			SUNTROFF_FONTS=$(SUNTROFF_FONTS) \
X			RSTDEVICE=dev$(RSTDEVICE) SUNDEVICE=dev$(SUNDEVICE) \
X			rstfonts
X
Xdevsun::
X		cp -r devsun ${WIDTHDIR}; \
X		cd ${WIDTHDIR}/devsun;  \
X		${MAKEDEV} DESC;	\
X		rm -f [a-zA-Z] [a-zA-Z][a-zA-Z]
X
XMakefiles::
X	$(RM) devpsc/Makefile.bak
X	- at if [ -f devpsc/Makefile ]; then \
X	echo "$(MV) devpsc/Makefile devpsc/Makefile.bak"; \
X	$(MV) devpsc/Makefile devpsc/Makefile.bak; \
X	else exit 0; fi
X	cd devpsc; ../$(IMAKE) -TImake.tmpl -I../$(IRULESRC) \
X		-s Makefile $(IMAKE_DEFINES) -DTOPDIR=../$(TOP); \
X		$(MAKE) $(MFLAGS) Makefiles
X
Xdevpsc::
X		cd devpsc; make $(MFLAGS) MAKEDEV=$(MAKEDEV) \
X			WIDTHDIR=$(WIDTHDIR) install
X
Xclean::
X		rm -f xtroff.man
X		cd devpsc; make clean
X
Xtar:
X		make clean
X		-rm /tmp/xtroff.tar.Z
X		cd ..; tar cvfX - xtroff/ExcludeFiles ./xtroff \
X			| compress > /tmp/xtroff.tar.Z 
X
Xlint:
X	cd XtStuff; make llib-lXtStuff.ln
X	lint -abz $(SRCS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES) \
X		XtStuff/llib-lXtStuff.ln -lXaw -lXt -lX11 -lm $(LINTFLAGS)
END_OF_FILE
if test 6533 -ne `wc -c <'xtroff/Imakefile'`; then
    echo shar: \"'xtroff/Imakefile'\" unpacked with wrong size!
fi
# end of 'xtroff/Imakefile'
fi
if test -f 'xtroff/XtStuff/Makefile' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/XtStuff/Makefile'\"
else
echo shar: Extracting \"'xtroff/XtStuff/Makefile'\" \(7825 characters\)
sed "s/^X//" >'xtroff/XtStuff/Makefile' <<'END_OF_FILE'
X# Makefile generated by imake - do not edit!
X# $XConsortium: imake.c,v 1.37 88/10/08 20:08:30 jim Exp $
X#
X# The cpp used on this machine replaces all newlines and multiple tabs and
X# spaces in a macro expansion with a single space.  Imake tries to compensate
X# for this, but is not always successful.
X#
X
X###########################################################################
X# X Window System Makefile generated from template file Imake.tmpl
X# $XConsortium: Imake.tmpl,v 1.91 88/10/23 22:37:10 jim Exp $
X#
X# Do not change the body of the imake template file.  Server-specific
X# parameters may be set in the appropriate .macros file; site-specific
X# parameters (but shared by all servers) may be set in site.def.  If you
X# make any changes, you'll need to rebuild the makefiles using
X# "make World" (at best) or "make Makefile; make Makefiles" (at least) in
X# the top level directory.
X#
X# If your C preprocessor doesn't define any unique symbols, you'll need
X# to set BOOTSTRAPCFLAGS when rebuilding imake (usually when doing
X# "make Makefile", "make Makefiles", or "make World").
X#
X# If you absolutely can't get imake to work, you'll need to set the
X# variables at the top of each Makefile as well as the dependencies at the
X# bottom (makedepend will do this automatically).
X#
X
X###########################################################################
X# platform-specific configuration parameters - edit Sun.macros to change
X
X# platform:  $XConsortium: Sun.macros,v 1.52 88/10/23 11:00:55 jim Exp $
X# operating system:   SunOS 3.5
X
XBOOTSTRAPCFLAGS =
X             AS = as
X             CC = cc
X            CPP = /lib/cpp
X             LD = ld
X           LINT = lint
X        INSTALL = install
X           TAGS = ctags
X             RM = rm -f
X             MV = mv
X             LN = ln -s
X         RANLIB = ranlib
XRANLIBINSTFLAGS = -t
X             AR = ar clq
X             LS = ls
X       LINTOPTS = -axz
X    LINTLIBFLAG = -C
X           MAKE = make
XSTD_CPP_DEFINES =
X    STD_DEFINES =
X
X###########################################################################
X# site-specific configuration parameters - edit site.def to change
X
X# site:  $XConsortium: site.def,v 1.16 88/10/12 10:30:24 jim Exp $
X
X   GCC = gcc -traditional
X    CC = $(GCC)
X
XCC = gcc -traditional
X
X XWSRC = $(CONTRIBSRC)/widgets/Xhp/Xw
X
X XWLIB = $(USRLIBDIR)/libXw.a
X
X###########################################################################
X# definitions common to all Makefiles - do not edit
X
X          SHELL =  /bin/sh
X
X        DESTDIR =
X      USRLIBDIR = /local/lib/X11
X         BINDIR = /local/bin/X11
X         INCDIR = $(LIBDIR)/include
X        INCROOT = $(DESTDIR)/usr/include
X         ADMDIR =  /scr/Xerrors
X         LIBDIR = /local/share/X11
X     LINTLIBDIR = $(LIBDIR)/lint
X        FONTDIR = $(LIBDIR)/fonts
X       XINITDIR = $(LIBDIR)/xinit
X         XDMDIR = $(LIBDIR)/xdm
X         UWMDIR = $(LIBDIR)/uwm
X         AWMDIR = $(LIBDIR)/awm
X         TWMDIR = $(LIBDIR)/twm
X        MANPATH = /local/man
X  MANSOURCEPATH = $(MANPATH)/man
X         MANDIR = $(MANSOURCEPATH)x
X      LIBMANDIR = $(MANSOURCEPATH)3
X    XAPPLOADDIR = $(LIBDIR)/app-defaults
X
X   INSTBINFLAGS = -m 0755
X   INSTUIDFLAGS = -m 4755
X   INSTLIBFLAGS = -m 0664
X   INSTINCFLAGS = -m 0444
X   INSTMANFLAGS = -m 0444
X   INSTAPPFLAGS = -m 0444
X  INSTKMEMFLAGS = -g kmem -m 2755
X        FCFLAGS = -t
X    CDEBUGFLAGS = -O
X
X        PATHSEP = /
X         DEPEND = $(DEPENDSRC)/makedepend
X          IMAKE = $(IMAKESRC)/imake
X            RGB = $(RGBSRC)/rgb
X             FC = $(BDFTOSNFSRC)/bdftosnf
X      MKFONTDIR = $(MKFONTDIRSRC)/mkfontdir
X      MKDIRHIER = $(SCRIPTSSRC)/mkdirhier.sh
X
X         CFLAGS = $(CDEBUGFLAGS) $(INCLUDES) $(STD_DEFINES) $(DEFINES)
X      LINTFLAGS = $(LINTOPTS) $(INCLUDES) $(STD_DEFINES) $(DEFINES) -DLINT
X        LDFLAGS = $(CDEBUGFLAGS) $(SYS_LIBRARIES) $(SYSAUX_LIBRARIES)
X            TOP = ../../../../../csri3/X.V11R3
X      CLIENTSRC = $(TOP)/clients
X        DEMOSRC = $(TOP)/demos
X         LIBSRC = $(TOP)/lib
X        FONTSRC = $(TOP)/fonts
X     INCLUDESRC = $(TOP)/X11
X      SERVERSRC = $(TOP)/server
X        UTILSRC = $(TOP)/util
X     SCRIPTSSRC = $(UTILSRC)/scripts
X     EXAMPLESRC = $(TOP)/examples
X     CONTRIBSRC = $(TOP)/contrib
X         DOCSRC = $(TOP)/doc
X         RGBSRC = $(TOP)/rgb
X      DEPENDSRC = $(UTILSRC)/makedepend
X       IMAKESRC = $(UTILSRC)/imake
X       IRULESRC = $(UTILSRC)/imake.includes
X        XLIBSRC = $(LIBSRC)/X
X         XMUSRC = $(LIBSRC)/Xmu
X     TOOLKITSRC = $(LIBSRC)/Xt
X     AWIDGETSRC = $(LIBSRC)/Xaw
X     OLDXLIBSRC = $(LIBSRC)/oldX
X    BDFTOSNFSRC = $(FONTSRC)/bdftosnf
X   MKFONTDIRSRC = $(FONTSRC)/mkfontdir
X   EXTENSIONSRC = $(TOP)/extensions
X
X   EXTENSIONLIB = $(USRLIBDIR)/lib/libXext.a
X           XLIB = $(USRLIBDIR)/libX11.a
X         XMULIB = $(USRLIBDIR)/libXmu.a
X        OLDXLIB = $(USRLIBDIR)/liboldX.a
X       XTOOLLIB = $(USRLIBDIR)/libXt.a
X         XAWLIB = $(USRLIBDIR)/libXaw.a
X       INCLUDES = -I$(INCDIR) -I$(INCROOT)
X
X       LINTXLIB = $(XLIBSRC)/llib-lX11.ln
X        LINTXMU = $(XMUSRC)/llib-lXmu.ln
X      LINTXTOOL = $(TOOLKITSRC)/llib-lXt.ln
X        LINTXAW = $(AWIDGETSRC)/llib-lXaw.ln
X      MACROFILE = Sun.macros
X   ICONFIGFILES = $(IRULESRC)/Imake.tmpl \
X			$(IRULESRC)/$(MACROFILE) $(IRULESRC)/site.def
X  IMAKE_DEFINES =
X      IMAKE_CMD = $(NEWTOP)$(IMAKE) -TImake.tmpl -I$(NEWTOP)$(IRULESRC) \
X			-s Makefile $(IMAKE_DEFINES)
X         RM_CMD = $(RM) *.CKP *.ln *.BAK *.bak *.o core errs ,* *~ *.a \
X			.emacs_* tags TAGS make.log MakeOut
X
X###########################################################################
X# rules:  $XConsortium: Imake.rules,v 1.71 88/10/23 22:46:34 jim Exp $
X
X###########################################################################
X# start of Imakefile
X
X    STD_DEFINES =
X    CDEBUGFLAGS = -O
X       INCLUDES = -I. -I$(XLIBSRC) \
X		-I$(TOP) -I$(TOP)/X11
X   INSTALLFLAGS = $(INSTINCFLAGS)
X       LINTLIBS = $(LINTXLIB)
X
XHEADERS = Menu.h MenuP.h CheckItem.h CheckItemP.h MenuItem.h MenuItemP.h \
X	Window.h WindowP.h Minibuf.h MinibufP.h
X# Some systems don't have usleep - we provide a lousy substitute
XOBJS = Menu.o CheckItem.o MenuItem.o Window.o Minibuf.o ask.o util.o # usleep.o
XSRCS = Menu.c CheckItem.c MenuItem.c Window.c Minibuf.c ask.c util.c # usleep.c
X
Xall:: libXtStuff.a
X
XlibXtStuff.a: $(OBJS)
X	$(RM) $@
X	$(AR) $@ $(OBJS)
X	$(RANLIB) $@
X
Xlintlib:: llib-lXtStuff.ln
X
Xllib-lXtStuff.ln: $(SRCS)
X	$(RM) $@
X	$(LINT) $(LINTLIBFLAG)XtStuff $(LINTFLAGS) $(SRCS)
X
Xinstall:: libXtStuff.a
X	$(INSTALL) -c $(INSTLIBFLAGS) libXtStuff.a $(USRLIBDIR)
X	$(RANLIB) $(RANLIBINSTFLAGS) $(USRLIBDIR)/libXtStuff.a
X
Xinstall.ln:: llib-lXtStuff.ln
X	$(INSTALL) -c $(INSTLIBFLAGS) llib-lXtStuff.ln $(LINTLIBDIR)
X
Xinstall:: $(HEADERS)
X	@case '${MFLAGS}' in *[i]*) set +e;; esac; \
X	for i in $(HEADERS); do \
X	(set -x; $(INSTALL) -c $(INSTALLFLAGS) $$i $(INCDIR)); \
X	done
X
Xdepend:
X
X###########################################################################
X# Imake.tmpl common rules for all Makefiles - do not edit
X
Xemptyrule::
X
Xclean::
X	$(RM_CMD) \#*
X
XMakefile:: $(IMAKE)
X
XMakefile:: Imakefile \
X	$(IRULESRC)/Imake.tmpl \
X	$(IRULESRC)/Imake.rules \
X	$(IRULESRC)/site.def \
X	$(IRULESRC)/$(MACROFILE)
X	- at if [ -f Makefile ]; then \
X	echo "$(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
X	$(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
X	else exit 0; fi
X	$(IMAKE_CMD) -DTOPDIR=$(TOP)
X
X$(IMAKE):
X	@echo "making $@"; \
X	cd $(IMAKESRC); $(MAKE) BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS)
X
Xtags::
X	$(TAGS) -w *.[ch]
X	$(TAGS) -xw *.[ch] > TAGS
X
X###########################################################################
X# empty rules for directories that do not have SUBDIRS - do not edit
X
Xinstall::
X	@echo "install done"
X
Xinstall.man::
X	@echo "install.man done"
X
XMakefiles::
X
X###########################################################################
X# dependencies generated by makedepend
X
END_OF_FILE
if test 7825 -ne `wc -c <'xtroff/XtStuff/Makefile'`; then
    echo shar: \"'xtroff/XtStuff/Makefile'\" unpacked with wrong size!
fi
# end of 'xtroff/XtStuff/Makefile'
fi
if test -f 'xtroff/fontstuff/ch2rst.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/fontstuff/ch2rst.c'\"
else
echo shar: Extracting \"'xtroff/fontstuff/ch2rst.c'\" \(6978 characters\)
sed "s/^X//" >'xtroff/fontstuff/ch2rst.c' <<'END_OF_FILE'
X/* ch2rst.c	1.4	84/04/07
X *
X * Font translation to Imagen-style fonts (RST format) from character format.
X *
X *	Use:	ch2rst  [ -i  -s ]  charfile  > rstfile
X *
X *		Takes input from charfile (which must be in the format written
X *	by rst2ch), converts to rst format and writes to stdout.  If charfile
X *	is missing, stdin is read.  The -i flag tells ch2rst to ignore the
X *	character codes at the start of each glyph definition, and pack the
X *	glyphs in consecutive code positions starting with 0.  The -s flag
X *	forces ch2rst to NOT trim off any white space in the glyph map.  This
X *	is usefull to make stipples of fixed size.
X */
X
X#include <stdio.h>
X#include <ctype.h>
X#include "rst.h"
X
X
X#define PREAMBLE	44			/* size of preamble */
X#define STRINGS		2			/* length of strings at pre. */
X#define STARTGLYPH	PREAMBLE + STRINGS
X#define MAXLINE		250
X#define GLYPHSPACE	(MAXLINE * MAXLINE)
X#define wr1(x)		putchar(x)
X
X
Xchar *	rdchar();
Xchar *	malloc();
X
Xglyph_dir g[DIRSIZ];		/* directory of glyph definitions */
Xpreamble p;			/* set of variables for preamble */
Xdouble widthtofix = 1.0 / FIXPIX;	/* fix conversion factor */
X
Xint	code, codeindex;
Xint	width, length, maxv, minv, maxh, minh, refv, refh;
Xint	bitwidth;
X
Xint	ignorecode = 0;
Xint	stipple = 0;
XFILE *	filep;
Xchar	ibuff[MAXLINE];
Xchar	ebuff[MAXLINE];
Xchar *	glyphs[DIRSIZ];
Xchar	charbits[GLYPHSPACE];	/* place to store bits for a glyph */
X
X
X
Xmain(argc,argv)
Xint argc;
Xchar **argv;
X{
X    register int i;
X    register int j;
X    register int k;
X    register char *chp;
X    register char *bitp;
X    float par;
X
X    while (argc > 1 && argv[1][0] == '-') {
X	switch(argv[1][1]) {
X	case 'i':
X		ignorecode = 1;
X		break;
X
X	case 's':
X		stipple = 1;
X		break;
X	default:
X		error("%s, unknown option flag", argv[1]);
X	}
X	argc--; argv++;
X    }
X
X    if (argc == 2) {
X	if ((filep = fopen (argv[1], "r")) == NULL)
X	    error("can't open file \"%s\"", argv[1]);
X    } else filep = stdin;
X
X    codeindex = 0;
X    for (i = 0; i < DIRSIZ; glyphs[i++] = (char *) 0);
X
X    fgets(ibuff, MAXLINE, filep);
X    if (strcmp(ibuff, "fontheader\n"))
X	error("not a character font file");
X
X    while (fgets(ibuff, MAXLINE, filep) != NULL) {
X	if (index(ibuff, '\n') == 0)
X	    error("input line too long");
X
X	if (ibuff[0] != ':') {
X	    sscanf (ibuff, "%s %f", ebuff, &par);
X	    if (strcmp(ebuff, "size") == 0) p.p_size = par + 0.5;
X	    else if (strcmp(ebuff, "version") == 0) {
X		if (p.p_version = par + 0.5)
X		    error("wrong version (%d) for Font file.", p.p_version);
X	    } else if (strcmp(ebuff, "mag") == 0) {
X		p.p_mag = par + 0.5;
X		if (p.p_mag) widthtofix = 1000.0 / (FIXPIX * p.p_mag);
X	    } else if (strcmp(ebuff, "desiz") == 0) p.p_desiz = par / FIX + 0.5;
X	    else if (strcmp(ebuff, "linesp") == 0)
X		p.p_linesp = par * widthtofix + 0.5;
X	    else if (strcmp(ebuff, "wordsp") == 0)
X		p.p_wordsp = par * widthtofix + 0.5;
X	    else if (strcmp(ebuff, "rot") == 0) p.p_rot = par + 0.5;
X	    else if (strcmp(ebuff, "cadv") == 0) p.p_cadv = par + 0.5;
X	    else if (strcmp(ebuff, "ladv") == 0) p.p_ladv = par + 0.5;
X	    else if (strcmp(ebuff, "id") == 0) p.p_id = par + 0.5;
X	    else if (strcmp(ebuff, "res") == 0) {
X		if ((p.p_res = par + 0.5) != RES)
X		    error("wrong resolution in Font file.", p.p_res);
X	    } else
X		error("unknown input descriptor, \"%s\"", ebuff);
X	} else {
X	    if (sscanf (ibuff, ":%d, width = %f", &code, &par) != 2)
X		error("bad glyph header, %s", ibuff);
X	    if (ignorecode) i = codeindex++; else i = code;
X	    g[i].g_pwidth = par * widthtofix + 0.5;
X
X	    chp = &charbits[0];
X	    if (fgets(chp, MAXLINE, filep) == NULL)
X		error("unexpected end of input");
X	    width = strlen(chp) - 1;
X	    minh = width;
X	    maxh = 0;
X	    refv = minv = -1;
X
X	    for (length = 0; *chp != '\n'; length++) {
X		if ((length + 1) * width > GLYPHSPACE)
X		    error ("out of glyph space");
X		for (j = 0; j < width; j++, chp++) {
X		    switch (*chp) {
X			case '.':
X				break;
X			case 'x':
X				refh = j;
X				refv = length;
X				*chp = '.';
X				break;
X			case 'X':
X				refh = j;
X				refv = length;
X			case '@':
X			case '*':
X				maxv = length;
X				if (minv < 0) minv = length;
X				if (j < minh) minh = j;
X				if (j > maxh) maxh = j;
X				break;
X			default:
X				error("illegal character '%c' in map.", *chp);
X		    } /* switch */
X		} /* for j */
X		if (fgets(chp, MAXLINE, filep) == NULL)
X			error("unexpected end of input");
X	    } /* for length */
X
X	    if (stipple) {		/* use the whole box to make a */
X		minv = 0;		/* stipple pattern. */
X		minh = 0;
X		maxv = length - 1;
X		maxh = width - 1;
X	    }
X
X	    if (refv < 0) error("no reference point in glyph %d.", code);
X	    if (minv < 0) {
X		minv = maxv = refv;
X		minh = maxh = refh;
X	    }
X	    g[i].g_height = maxv + 1 - minv;
X	    g[i].g_width = maxh + 1 - minh;
X	    g[i].g_up = refv - minv;
X	    g[i].g_left = refh - minh;
X	    g[i].g_bitp = g[i].g_height * ((g[i].g_width + 7) / 8);
X
X
X	    bitp = (glyphs[i] = malloc(g[i].g_bitp)) - 1;
X	    for (k = minv; k <= maxv; k++) {
X		chp = &charbits[0] + width * k + minh;
X		bitwidth = 0;
X		for (j = minh; j <= maxh; j++, chp++) {
X		    if (--bitwidth < 0) {
X			*++bitp = '\0';
X			bitwidth = 7;
X		    }
X		    if (*chp != '.') *bitp |= 1 << bitwidth;
X		}
X	    } /* for */
X	} /* else */
X    } /* while */
X
X    if (ignorecode) {
X	i = codeindex;
X	p.p_last = i - 1;
X	p.p_first = 0;
X    } else {
X	for (i = DIRSIZ - 1; glyphs[i] == (char *) 0; i--);
X	p.p_last = i;
X	for (j = 0; glyphs[j] == (char *) 0; j++);
X	p.p_first = j;
X    }
X    bitwidth = STARTGLYPH + 15 * (1 + p.p_last - p.p_first);
X
X    printf("Rast UCB");
X    wr2(p.p_size);	 wr1(p.p_version);	wr3(STARTGLYPH);
X    wr2(p.p_first);	 wr2(p.p_last);		wr4(p.p_mag);
X    wr4(p.p_desiz);	 wr4(p.p_linesp);	wr4(p.p_wordsp);
X    wr2(p.p_rot);	 wr1(p.p_cadv);		wr1(p.p_ladv);
X    wr4(p.p_id);	 wr2(p.p_res);
X    for (i = 0; i < STRINGS; i++) putchar('\0');
X
X    for (i = p.p_first; i <= p.p_last; i++) {
X	if (glyphs[i] == (char *) 0) {
X	    for (j = 0; j < 15; j++) putchar('\0');
X	} else {
X	    wr2(g[i].g_height);
X	    wr2(g[i].g_width);
X	    wr2(g[i].g_up);
X	    wr2(g[i].g_left);
X	    wr4(g[i].g_pwidth);
X	    wr3(bitwidth);
X	    bitwidth += g[i].g_bitp;
X	}
X    }
X    fflush(stdout);
X
X    for (i = p.p_first; i <= p.p_last; i++)
X	if (glyphs[i] != (char *) 0)
X	    vwrite(glyphs[i], g[i].g_bitp);
X}
X
X
Xvwrite(buf,usize)
Xchar *buf;
Xint usize;
X{
X	int tsize = 0;
X
X	while (usize) {
X		buf += tsize;
X		tsize = usize > BUFSIZ ? BUFSIZ : usize;
X		if ((tsize = write(1, buf, tsize)) < 0) {
X			perror("ch2rst: write failed");
X			exit(-1);
X		}
X		usize -= tsize;
X	}
X}
X
X
X/*VARARGS1*/
Xerror(string, a1, a2, a3, a4)
Xchar *string;
X{ 
X	fprintf(stderr, "ch2rst: ");
X	fprintf(stderr, string, a1, a2, a3, a4);
X	fprintf(stderr, "\n");
X	exit(8);
X};
X
X
Xwr2(i)
Xunsigned int i;
X{
X    wr1((i>>8)&255);
X    wr1(i&255);
X}
X
Xwr3(i)
Xunsigned int i;
X{
X    wr1((i>>16)&255);
X    wr1((i>>8)&255);
X    wr1(i&255);
X}
X
Xwr4(i)
Xunsigned int i;
X{
X    wr1((i>>24)&255);
X    wr1((i>>16)&255);
X    wr1((i>>8)&255);
X    wr1(i&255);
X}
END_OF_FILE
if test 6978 -ne `wc -c <'xtroff/fontstuff/ch2rst.c'`; then
    echo shar: \"'xtroff/fontstuff/ch2rst.c'\" unpacked with wrong size!
fi
# end of 'xtroff/fontstuff/ch2rst.c'
fi
if test -f 'xtroff/fontstuff/scalech.c' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/fontstuff/scalech.c'\"
else
echo shar: Extracting \"'xtroff/fontstuff/scalech.c'\" \(7064 characters\)
sed "s/^X//" >'xtroff/fontstuff/scalech.c' <<'END_OF_FILE'
X/*	scalech.c	(Berkeley)	1.4	84/04/12
X *
X * Font scaling for character format fonts.
X *
X *	Use:	scalech  [ -s# ]  charfile1  > charfile2
X *
X *		Takes input from charfile1 (which must be in the format
X *	written by rst2ch), scales by # (default = 50%) and writes to stdout.
X *	If charfile1 is missing, stdin is read.  The -s flag sets the scaling
X *	factor to # (which is a percentage REDUCTION - can't make fonts bigger)
X */
X
X#include <stdio.h>
X#include <ctype.h>
X
X
X#define MAXLINE		200
X#define MAXHEIGHT	200
X#define SCALE		50
X
X
Xint	width, length, vdest, hdest, code;
Xint	refv, refh, spot, start, Bduring, Wduring;
Xint	notfirsttime, build, voffset, hoffset;
X
Xint	scale = SCALE;
XFILE *	filep;
Xchar	ibuff[MAXHEIGHT][MAXLINE], ebuff[MAXLINE];
X
Xunsigned char lastline[MAXLINE];	/* last printed line */
Xunsigned char Black[2][MAXLINE];	/* arrays to figure new */
Xunsigned char WtoB[2][MAXLINE];		/* scaled line based on */
Xunsigned char BtoW[2][MAXLINE];		/* pixels within lines */
Xunsigned char White[2][MAXLINE];
X
X
Xmain(argc,argv)
Xint argc;
Xchar **argv;
X{
X    register int i;
X    register int j;
X    register char *chp;
X    float par;
X
X    while (argc > 1 && argv[1][0] == '-') {
X	switch(argv[1][1]) {
X	case 's':
X		scale = atoi (&(argv[1][2]));
X		break;
X	default:
X		error("%s, unknown option flag", argv[1]);
X	}
X	argc--; argv++;
X    }
X
X    if (argc == 2) {
X	if ((filep = fopen (argv[1], "r")) == NULL)
X	    error("can't open file \"%s\"", argv[1]);
X    } else filep = stdin;
X
X    fgets(ibuff, MAXLINE, filep);
X    if (strcmp(ibuff, "fontheader\n"))
X	error("not a character font file");
X    printf("fontheader\n");
X
X    while (fgets(ibuff, MAXLINE, filep) != NULL) {
X	if (index(ibuff, '\n') == 0)
X	    error("input line too long");
X
X	if (ibuff[0][0] != ':') {
X	    sscanf (ibuff, "%s %f", ebuff, &par);
X	    if (strcmp(ebuff, "mag") == 0)
X		printf("mag %d\n", (int) (par * scale / 100 + 0.1));
X	    else if (strcmp(ebuff, "linesp") == 0)
X		printf("linesp %.2f\n", par * scale / 100 + 0.001);
X	    else if (strcmp(ebuff, "wordsp") == 0)
X		printf("wordsp %.2f\n", par * scale / 100 + 0.001);
X	    else
X		printf("%s", ibuff);
X	} else {
X	    if (sscanf (ibuff, ":%d, width = %f", &code, &par) != 2)
X		error("bad glyph header, %s", ibuff);
X	    printf(":%d, width = %.2f\n", code, (par * scale) / 100.0 + 0.001);
X
X	    if (fgets(ibuff, MAXLINE, filep) == NULL)
X		error("unexpected end of input");
X	    width = strlen(&(ibuff[0][0])) - 1;
X						/* first read in whole glyph */
X	    refh = -1;				/* and put in ibuff */
X	    for (length = 0; *(chp = &(ibuff[length][0])) != '\n'; length++) {
X		for (j = 0; j < width; j++, chp++) {
X		    switch (*chp) {
X			case '@':
X			case '*':
X				*chp = 1;
X				break;
X			case '.':
X				*chp = 0;
X				break;
X			case 'x':
X				*chp = 0;
X				goto mark;
X			case 'X':
X				*chp = 1;
X		mark:		if (refh >= 0)
X				    error ("glyph %d - two reference points",
X									code);
X				refh = j + 1;
X				refv = length;
X				break;
X			default:
X				error("illegal character '%c' in map.", *chp);
X		    }
X		}
X		if (fgets(&(ibuff[length + 1][0]), MAXLINE, filep) == NULL)
X			error("unexpected end of input");
X	    }
X	    if (refh < 0) error("No position point in glyph %d", code);
X
X
X	    voffset = (refv * scale) / 100;
X	    hoffset = (refh * scale) / 100;
X	    vdest = 0;
X	    notfirsttime = 0;
X	    for (j = 0; j <= width; j++)
X		Black[build][j] = BtoW[build][j] =
X			WtoB[build][j] = White[build][j] = 0;
X
X	    for (i = 0; i < length; i++) {
X		chp = &(ibuff[i][0]);
X		hdest = 1;
X		start = 0;
X		Bduring = 0;
X		Wduring = 0;
X		White[build][0]++;
X		for (j = 0; j < width; j++, chp++) {
X		    code = ((j-refh) * scale) / 100 + (j<refh ? 1:2) + hoffset;
X		    if (hdest != code) {
X			if ((start && !Wduring) ||
X			    ((!start)&& Bduring &&!spot)) Black[build][hdest]++;
X			if (start && !spot) BtoW[build][hdest]++;
X			if ((!start) && spot) WtoB[build][hdest]++;
X			if (((!start) && !Bduring) ||
X			    (start && Wduring && spot)) White[build][hdest]++;
X
X			hdest = code;
X			start = spot;
X			Bduring = 0;
X			Wduring = 0;
X		    }
X
X		    spot = *chp;
X		    Bduring |= spot;
X		    Wduring |= !spot;
X		} /* for j */
X
X		if ((start && !Wduring)
X		    || ((!start) && Bduring)) Black[build][hdest]++;
X		if (start) BtoW[build][hdest]++;
X		if ((!start) && !Bduring) White[build][hdest]++;
X
X		code = voffset - (((refv - (i+1))*scale)/100 - (i>=refv ? 1:0));
X		if (code != vdest || i == (length - 1)) {
X		    if (notfirsttime)
X			outline(vdest == (voffset + 1));
X		    else
X			notfirsttime = 1;
X		    vdest = code;
X
X		    build = !build;
X		    for (j = 0; j <= width; j++)
X			Black[build][j] = BtoW[build][j] =
X				WtoB[build][j] = White[build][j] = 0;
X		}
X	    } /* for i */
X
X	    for (j = 0; j <= width; j++) White[build][j] = 1;
X	    outline(vdest == (voffset + 1));		/* output last line */
X	    putchar('\n');
X	} /* else */
X    } /* while */
X}
X
Xoutline(i)
Xregister int i;
X{
X	register int set;
X	register int output = !build;
X	register int j;
X	int oldset = 0;
X
X	for (j = 1; j <= hdest; j++) {
X					/* decide whether to put out a '.' */
X					/* or '@' spot for pixel j */
X		set = ((!BtoW[output][j]) << 3) | ((!WtoB[output][j]) << 2) |
X			((!White[output][j]) << 1) | !Black[output][j];
X		switch (set) {
X		case 14:	/* all black */
X		case 11:	/* all white->black */
X		case 10:	/* black and white->black */
X		case  2:	/* everything but all white */
X		    set = 1;
X		    break;
X
X		case 13:	/* all white */
X		case  7:	/* all black->white */
X		case  5:	/* white and black->white */
X		    set = 0;
X		    break;
X
X		case  1:	/* everything but all black */
X		    if (oldset && (Black[output][j+1] || WtoB[output][j+1]))
X			set = 0;
X		    else
X			set = 1;
X		    break;
X
X		case 12:	/* black and white only */
X		case  8:	/* black and white and white->black */
X		case  4:	/* black and white and black->white */
X		    if (Black[build][j])
X			set = !lastline[j];
X		    else
X			set = 1;
X		    break;
X
X		case  6:	/* black and black->white */
X		    if (lastline[j] && !White[build][j])
X			set = 0;
X		    else
X			set = 1;
X		    break;
X
X		case  9:	/* white and white->black */
X		    if ((!lastline[j] && !Black[build][j] && !WtoB[build][j])
X				|| White[output][j+1] || BtoW[output][j+1])
X			set = 1;
X		    else
X			set = 0;
X		    break;
X
X		case 15:	/* none of them */
X		case  3:	/* black->white and white->black */
X		case  0:	/* everything */
X		    if (lastline[j-1] + lastline[j] + lastline[j+1] + oldset +
X			(Black[output][j+1] || WtoB[output][j+1]) + 
X			(Black[build][j-1] || WtoB[build][j-1]) + 
X			(Black[build][j] || WtoB[build][j]) + 
X			(Black[build][j+1] || WtoB[build][j+1]) > 5)
X			set = 0;
X		    else
X			set = 1;
X		    break;
X		}
X
X		if (set)  {
X		    if (!i || j != (hoffset + 1))
X			putchar('@');
X		    else
X			putchar('X');
X		} else {
X		    if (!i || j != (hoffset + 1))
X			putchar('.');
X		    else
X			putchar('x');
X		}
X		lastline[j-1] = oldset;
X		oldset = set;
X	}
X	lastline[j-1] = oldset;
X	putchar('\n');
X}
X
X/*VARARGS1*/
Xerror(string, a1, a2, a3, a4)
Xchar *string;
X{ 
X	fprintf(stderr, "scalech: ");
X	fprintf(stderr, string, a1, a2, a3, a4);
X	fprintf(stderr, "\n");
X	exit(8);
X};
END_OF_FILE
if test 7064 -ne `wc -c <'xtroff/fontstuff/scalech.c'`; then
    echo shar: \"'xtroff/fontstuff/scalech.c'\" unpacked with wrong size!
fi
# end of 'xtroff/fontstuff/scalech.c'
fi
if test -f 'xtroff/lint.out' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/lint.out'\"
else
echo shar: Extracting \"'xtroff/lint.out'\" \(6473 characters\)
sed "s/^X//" >'xtroff/lint.out' <<'END_OF_FILE'
XTOPDIR=/csri3/X
XLINTDIR=/usr/lib/lint
XLIBSRC=/csri3/X/lib
X+ sed -e /^[^:]*:$/d -e /\?\?\?/d -e /long assignment/d -e /assignment to long/d -e /llib.*:: *llib/d -e s,llib-lX11:,/csri3/X/lib/X/, -e s,llib-lXt:,/csri3/X/lib/Xt/, -e s,llib-lXaw:,/csri3/X/lib/Xaw/, -e s,llib-lXmu:,/csri3/X/lib/Xmu/, -e s,llib-lXw:,/csri3/X/lib/Xw/, -e s,llib-lXext:,/csri3/X/lib/Xext/, -e s,llib-loldX:,/csri3/X/lib/oldX/, -e s,\(llib-l[^(]*(\),/usr/lib/lint/\1, 
Xlint -abz xwindows.c suntroff.c parse.c font.c draw.c  fixpoint.c curves.c arc.c  -lm \
X	 -lXaw -lXt -lX11 -lm -axz -I./bitmaps -I./XtStuff -I../../../../csri3/X.V11R3  -DFONTDIR=\"/local/share/troff\" -DBITDIR=\"/local/share/X11/fonts/xtroff\"   -DNOADJUST -DSLOWARCS -DLINT
Xxwindows.c(534): static variable RecordMapStatus unused
XXDrawArc multiply declared	arc.c(160)  ::  /csri3/X/lib/X/XDrArc.c(21)
XXDrawArcs multiply declared	arc.c(170)  ::  /csri3/X/lib/X/XDrArcs.c(14)
XXFillArc multiply declared	arc.c(186)  ::  /csri3/X/lib/X/XFillArc.c(19)
XXFillArcs multiply declared	arc.c(196)  ::  /csri3/X/lib/X/XFillArcs.c(14)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  xwindows.c(962)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  xwindows.c(978)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  xwindows.c(987)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  xwindows.c(1000)
XXtMoveWidget value declared inconsistently	/csri3/X/lib/Xt/Geometry.c(281)  ::  xwindows.c(1155)
Xsprintf value declared inconsistently	/usr/lib/lint/llib-lc(512)  ::  xwindows.c(1199)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(111)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(120)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(148)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(356)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(410)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(680)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(735)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  suntroff.c(763)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(792)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  suntroff.c(893)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  suntroff.c(940)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  suntroff.c(990)
Xsprintf value declared inconsistently	/usr/lib/lint/llib-lc(512)  ::  suntroff.c(749)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  parse.c(157)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  parse.c(162)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  parse.c(190)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  parse.c(198)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  parse.c(267)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(94)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(96)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(206)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(234)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(238)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(324)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(333)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(369)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  font.c(398)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(468)
Xmalloc, arg. 1 used inconsistently	/usr/lib/lint/llib-lc(349)  ::  font.c(732)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(734)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(820)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(856)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(881)
Xwarning, arg. 1 used inconsistently	xwindows.c(1119)  ::  font.c(915)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(943)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  font.c(1003)
Xsprintf value declared inconsistently	/usr/lib/lint/llib-lc(512)  ::  font.c(737)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  draw.c(107)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  draw.c(110)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  draw.c(146)
Xfatal, arg. 1 used inconsistently	xwindows.c(1102)  ::  draw.c(150)
XRepaintCanvas value declared inconsistently	xwindows.c(497)  ::  draw.c(98)
XXDrawArcs defined( arc.c(170) ), but never used
XXFillArcs defined( arc.c(196) ), but never used
Xunlink returns value which is always ignored
XRecordMapStatus defined( xwindows.c(537) ), but never used
XXLookupString returns value which is always ignored
XShowPage returns value which is sometimes ignored
XXFetchName returns value which is always ignored
XXQueryPointer returns value which is always ignored
XwindowWidgetClass used( xwindows.c(374) ), but not defined
Xconfirm defined( xwindows.c(1355) ), but never used
XVirtualLoadFont returns value which is always ignored
XminibufWidgetClass used( xwindows.c(419) ), but not defined
Xstrcat returns value which is always ignored
Xstrcpy returns value which is always ignored
Xstrncpy returns value which is always ignored
Xsystem returns value which is always ignored
Xfclose returns value which is always ignored
Xfflush returns value which is always ignored
X_flsbuf returns value which is always ignored
Xfprintf returns value which is always ignored
Xfread returns value which is always ignored
Xfseek returns value which is always ignored
Xprintf returns value which is always ignored
Xsprintf returns value which is always ignored
Xsscanf returns value which is always ignored
XGetChar returns value which is sometimes ignored
XGetNumber returns value which is sometimes ignored
XmenuWidgetClass used( xwindows.c(410) ), but not defined
XGetLine returns value which is always ignored
XGetWord returns value which is always ignored
Xditroff_bits defined( ./bitmaps/ditroff.bm(3) ), but never used
Xditroff_bits used( xwindows.c(440) ), but not defined
XPrintFontDirectory defined( font.c(753) ), but never used
XErrorsPending defined( xwindows.c(292) ), but never used
Xclose returns value which is always ignored
Xdrawline defined( curves.c(99) ), but never used
Xdup2 returns value which is always ignored
Xdrawthick defined( curves.c(332) ), but never used
Xdrawstyle defined( curves.c(346) ), but never used
END_OF_FILE
if test 6473 -ne `wc -c <'xtroff/lint.out'`; then
    echo shar: \"'xtroff/lint.out'\" unpacked with wrong size!
fi
# end of 'xtroff/lint.out'
fi
if test -f 'xtroff/suntroff.man' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/suntroff.man'\"
else
echo shar: Extracting \"'xtroff/suntroff.man'\" \(7315 characters\)
sed "s/^X//" >'xtroff/suntroff.man' <<'END_OF_FILE'
X.IX "suntroff"
X.IX "SunWindows" "suntroff"
X.TH SUNTROFF 1 "1 December 1986"
X.SH NAME
Xsuntroff - Sun Device Independent Troff Previewer
X.SH SYNOPSIS
X.br
X.B suntroff
X[
X.B Shell-Tool Arguments
X] [
X.B -scrollbars
X] [
X.B -command "Ditroff Command Pipe"
X]
X.sp
X.B
Xsuntroff 
X[
X.B Shell-Tool Arguments
X] [
X.B -scrollbars
X] [
X.B ditroff output file
X]
X.SH DESCRIPTION
X\fISuntroff\fR reads \fIditroff\fR(1) output files and displays
Xan approximation of the typeset output in a window on a Sun workstation.
XUsing the mouse the user can pan each page image within the window,
Xmove to other pages, look at different files and finally send the
Xfile to \fIlpr\fR(1) for typesetting.
X.PP
XThe program can be used in two different ways.
XPerhaps the most efficient way to use this program is to execute
X\fIsuntroff\fR in the command mode (first example in the
Xsynopsis above).
XIn the command mode a ditroff command string is specified that includes
Xall the processing steps (\fIeqn, tbl, pic, ideal, troff)\fR
Xthat are needed to transform a user's document into ditroff output.
XThen whenever a change is made in the document 
Xa "rerasterize" command 
Xcan be used to rerun
Xthe command string and show the new document on the screen.
XThe "rerasterize" command is an option available on a menu that pops
Xup when the right mouse button is pressed or in a status panel.
XThe status panel is also enabled using the menu that pops up with the
Xright mouse button.
XIt is important that the \fIditroff\fR command that ends the pipe include
Xthe \fI-t\fR flag so that \fIsuntroff\fR can read the output.
X.PP
XAlternatively, the output from \fIditroff\fR can be used as input
Xto this program (second example in the synopsis above.)
XIn this case, each time the document changes it is up to the user 
Xto rerun the \fIditroff\fR pipe to produce input for the \fIsuntroff\fR
Xprogram.
XThis can be easily done using the "rerasterize" command.
X.PP
XFonts used by \fIsuntroff\fR are rough approximations to those that
Xwill be printed in the final typesetter output.
XCurrently only the 300 dot per inch (dpi) Imagen fonts and the
X200 dpi Versatec fonts have been properly scaled for \fIsuntroff\fR.
XAll output destined for printers other than the Imagens will be
Xshown using Versatec fonts.
XAlthough the actual bit maps used for the
Xcharacters might not be correct
Xall \fIsuntroff\fR output will have the correct horizontal
Xand vertical spacing.
X.PP
X\fISuntroff\fR can be controlled using a combination of mouse, menu and
Xtyped commands.  
XWithin the main text window when the middle button of the mouse is
Xpressed the cursor is changed into the shape of a hand that grabs the
Xtext.  
XAs the mouse is moved around inside the window the displayed text (and
Xthe hand) move accordingly.
XWhen the right button is pressed a menu pops up that contains options
Xfor moving to different pages, print parts of the document, rerasterizing
Xthe input and finally popping up a more extensive status and command window.
X.PP
XThe \fIsuntroff\fR command and status window allows the user to
Xspecify the source of input, search for text within the document,
Xmove to any page within the document and to print either one page or the
Xentire document.
XThis panel is hidden at first and is displayed when the user picks the
X"show status" option on the right mouse button menu.
X.SH HOW TO
X.IP "Move Around within Page" 15
XUse the middle mouse button.  
XWhen it is first pressed a hand will appear on the page and effectively
Xgrab the text.
XAs the mouse (and hand) move the page will move within the frame.
X.IP "Go To Another Page"
XEnter the page number in the appropiate field of the status panel.
XThen click on the "Goto Page" button.
X
XAlternatively you can type the desired page number to the main \fISunTroff\fR
Xwindow followed by a carriage return (or new-line).
X
XAlso, you can go forward and backward a page using the entries in the 
Xright button pop up menu.
X.IP "Search for a Pattern"
XTo find a pattern in the output enter the desired search pattern in
Xthe status panel.
XNote, the only valid characters in a search pattern are printable ascii
Xcharacters and the space character.
XForward and backward searches are performed using the appropriate button
Xin the status panel.
XA search ignores the current page and will find the next page that
Xcontains the desired words.  
XHopefully, at some point in the future the desired pattern will be
Xhighlighted.
X.IP "Print Part of Document"
XEither a single page or the entire document can be printed using 
Xbuttons on the status panel or entries in the right button pop up
Xmenu.
XThe printer name entered in the status panel will be 
Xpassed directly to the \fIlpr\fR(1).  It is important that the
Xuser verify it is correct otherwise typesetting commands meant for
Xone type of printer might be sent to the wrong printer.
X.IP "Rerasterize"
XAfter changes are made to a document it is necessary to tell 
X\fISunTroff\fR to rerasterize the file. 
XThis can be done using either a button on the status panel or
Xan entry in the right mouse button pop up menu.
X.SH "EXAMPLES"
XTo preview a file that has already been processed by ditroff (using
Xthe -t option)
X.br
X	suntroff file-containing-ditroff-output
X.br
XWhen the "rerasterize" command is issued then the indicated file will
Xbe reopened and its new contents displayed.
X.sp
XTo typeset and preview a document use the following command
X.br
X	suntroff -command "deqn -Plw1 ditroff-input-file | ditroff -ms -Plw1 -t"
X.br
XNote that it is important to specify the "-t" option to ditroff so that
Xthe \fISunTroff\fR program can capture the output.
XThe "rerasterize" command will close any open files (or pipes) and
Xopen a new pipe.
XThe indicated command will be run on the input side of the pipe to
Xprovide \fISunTroff\fR with its input.
XThe command providing input to \fISunTroff\fR can contain any combination
Xof programs as long as the final output is \fIditroff\fR output.
X.SH "SEE ALSO"
X.LP
X.IR suntools (1)
X.IR ditroff (1)
X.br
X.SH BUGS
XDue to bugs in SunView, scrollbars do not work.  
XHopefully this problems will be fixed in a future release
Xof Sun software.
X.PP
XSomeday, the search commands will highlight the text that they find.
XThis will be much easier on the user.
X.SH AUTHOR
XCredit for this program goes to a number of people including
XBrian Kernighan (Bell Labs) for first developing Device Independent
XTroff, U. C. Berkeley for developing the original \fIvcat\fR program.
XRichard L. Hyde, Purdue University, and David Slattengren, U.C. Berkeley,
Xwrote the original version of this program to rasterize \fIditroff\fR
Xoutput for the Suns.
XFinally Malcolm Slaney, Schlumberger Palo Alto Research, rewrote most
Xof the code to make it run under Sun-3 Unix and to extend the
Xuser interface.
XNeedless to say, credit for all good portions of this program should
Xgo to the first authors; blame for the bad sections rests with the
Xfinal author.
X.SH SUPPORT
XThis command was developed as an independent project to satisfy a need
Xof the author.
XThis program may contain bugs and the user is cautioned to independently
Xverify that the program is suitable for the user's intended purpose.
XThe program is made available on an ``as is'' basis with all
Xfaults and without any implied or expressed warranties or support
Xfrom either the author, Malcolm Slaney, or the Schlumberger
XPalo Alto Research Laboratory.
END_OF_FILE
if test 7315 -ne `wc -c <'xtroff/suntroff.man'`; then
    echo shar: \"'xtroff/suntroff.man'\" unpacked with wrong size!
fi
# end of 'xtroff/suntroff.man'
fi
if test -f 'xtroff/xfonts/adobe.awk' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'xtroff/xfonts/adobe.awk'\"
else
echo shar: Extracting \"'xtroff/xfonts/adobe.awk'\" \(7712 characters\)
sed "s/^X//" >'xtroff/xfonts/adobe.awk' <<'END_OF_FILE'
X# local/fonts/bdf/adobe.awk
X#
X# Copyright  (c) 1988 Cray Research, Inc.  All Rights Reserved.
X#
X# This awk(1) program allocates ENCODING space to PostScript
X# encoding sequence.
X#
X# David A. Cahlander 88/12/17.
X#
X
X# allocation of extended characters
X
XBEGIN {
X	adobe["space"] = 32
X	adobe["exclam"] = 33
X	adobe["quotedbl"] = 34
X	adobe["numbersign"] = 35
X	adobe["dollar"] = 36
X	adobe["percent"] = 37
X	adobe["ampersand"] = 38
X	adobe["quoteright"] = 39
X	adobe["parenleft"] = 40
X	adobe["parenright"] = 41
X	adobe["asterisk"] = 42
X	adobe["plus"] = 43
X	adobe["comma"] = 44
X	adobe["hyphen"] = 45
X#	adobe["minus"] = 45	# minus is in Symbol set
X	adobe["period"] = 46
X	adobe["slash"] = 47
X	adobe["zero"] = 48
X	adobe["one"] = 49
X	adobe["two"] = 50
X	adobe["three"] = 51
X	adobe["four"] = 52
X	adobe["five"] = 53
X	adobe["six"] = 54
X	adobe["seven"] = 55
X	adobe["eight"] = 56
X	adobe["nine"] = 57
X	adobe["colon"] = 58
X	adobe["semicolon"] = 59
X	adobe["less"] = 60
X	adobe["equal"] = 61
X	adobe["greater"] = 62
X	adobe["question"] = 63
X	adobe["at"] = 64
X	adobe["A"] = 65
X	adobe["B"] = 66
X	adobe["C"] = 67
X	adobe["D"] = 68
X	adobe["E"] = 69
X	adobe["F"] = 70
X	adobe["G"] = 71
X	adobe["H"] = 72
X	adobe["I"] = 73
X	adobe["J"] = 74
X	adobe["K"] = 75
X	adobe["L"] = 76
X	adobe["M"] = 77
X	adobe["N"] = 78
X	adobe["O"] = 79
X	adobe["P"] = 80
X	adobe["Q"] = 81
X	adobe["R"] = 82
X	adobe["S"] = 83
X	adobe["T"] = 84
X	adobe["U"] = 85
X	adobe["V"] = 86
X	adobe["W"] = 87
X	adobe["X"] = 88
X	adobe["Y"] = 89
X	adobe["Z"] = 90
X	adobe["bracketleft"] = 91
X	adobe["backslash"] = 92
X	adobe["bracketright"] = 93
X	adobe["asciicircum"] = 94
X	adobe["underscore"] = 95
X	adobe["quoteleft"] = 96
X	adobe["a"] = 97
X	adobe["b"] = 98
X	adobe["c"] = 99
X	adobe["d"] = 100
X	adobe["e"] = 101
X	adobe["f"] = 102
X	adobe["g"] = 103
X	adobe["h"] = 104
X	adobe["i"] = 105
X	adobe["j"] = 106
X	adobe["k"] = 107
X	adobe["l"] = 108
X	adobe["m"] = 109
X	adobe["n"] = 110
X	adobe["o"] = 111
X	adobe["p"] = 112
X	adobe["q"] = 113
X	adobe["r"] = 114
X	adobe["s"] = 115
X	adobe["t"] = 116
X	adobe["u"] = 117
X	adobe["v"] = 118
X	adobe["w"] = 119
X	adobe["x"] = 120
X	adobe["y"] = 121
X	adobe["z"] = 122
X	adobe["braceleft"] = 123
X	adobe["bar"] = 124
X	adobe["braceright"] = 125
X	adobe["asciitilde"] = 126
X	adobe["onequarter"] = 129	#incorrect
X	adobe["onehalf"] = 130		#incorrect
X	adobe["threequarters"] = 131	#incorrect
X	adobe["exclamdown"] = 161
X	adobe["cent"] = 162
X	adobe["sterling"] = 163
X	adobe["fraction"] = 164
X	adobe["yen"] = 165
X	adobe["florin"] = 166
X	adobe["section"] = 167
X	adobe["currency"] = 168
X	adobe["quotesingle"] = 169
X	adobe["quotedblleft"] = 170
X	adobe["guillemotleft"] = 171
X	adobe["guilsinglleft"] = 172
X	adobe["guilsinglright"] = 173
X	adobe["fi"] = 174
X	adobe["fl"] = 175
X	adobe["endash"] = 177
X	adobe["dagger"] = 178
X	adobe["daggerdbl"] = 179
X	adobe["periodcentered"] = 180
X	adobe["paragraph"] = 182
X	adobe["bullet"] = 183
X	adobe["quotesinglbase"] = 184
X	adobe["quotedblbase"] = 185
X	adobe["quotedblright"] = 186
X	adobe["guillemotright"] = 187
X	adobe["ellipsis"] = 188
X	adobe["perthousand"] = 189
X	adobe["questiondown"] = 191
X	adobe["grave"] = 193
X	adobe["acute"] = 194
X	adobe["circumflex"] = 195
X	adobe["tilde"] = 196
X	adobe["macron"] = 197
X	adobe["breve"] = 198
X	adobe["dotaccent"] = 199
X	adobe["dieresis"] = 200
X	adobe["ring"] = 202
X	adobe["cedilla"] = 203
X	adobe["hungarumlaut"] = 205
X	adobe["ogonek"] = 206
X	adobe["caron"] = 207
X	adobe["emdash"] = 208
X	adobe["AE"] = 225
X	adobe["ordfeminine"] = 227
X	adobe["Lslash"] = 232
X	adobe["Oslash"] = 233
X	adobe["OE"] = 234
X	adobe["ordmasculine"] = 235
X	adobe["ae"] = 241
X	adobe["dotlessi"] = 245
X	adobe["lslash"] = 248
X	adobe["oslash"] = 249
X	adobe["oe"] = 250
X	adobe["germandbls"] = 251
X	adobe["Aacute"] = 256
X	adobe["Acircumflex"] = 257
X	adobe["Adieresis"] = 258
X	adobe["Agrave"] = 259
X	adobe["Aring"] = 260
X	adobe["Atilde"] = 261
X	adobe["Ccedilla"] = 262
X	adobe["Eacute"] = 263
X	adobe["Ecircumflex"] = 264
X	adobe["Edieresis"] = 265
X	adobe["Egrave"] = 266
X	adobe["Iacute"] = 267
X	adobe["Icircumflex"] = 268
X	adobe["Idieresis"] = 269
X	adobe["Igrave"] = 270
X	adobe["Ntilde"] = 271
X	adobe["Oacute"] = 272
X	adobe["Ocircumflex"] = 273
X	adobe["Odieresis"] = 274
X	adobe["Ograve"] = 275
X	adobe["Otilde"] = 276
X	adobe["Scaron"] = 277
X	adobe["Uacute"] = 278
X	adobe["Ucircumflex"] = 279
X	adobe["Udieresis"] = 280
X	adobe["Ugrave"] = 281
X	adobe["Ydieresis"] = 282
X	adobe["Zcaron"] = 283
X	adobe["aacute"] = 284
X	adobe["acircumflex"] = 285
X	adobe["adieresis"] = 286
X	adobe["agrave"] = 287
X	adobe["aring"] = 288
X	adobe["atilde"] = 289
X	adobe["ccedilla"] = 290
X	adobe["eacute"] = 291
X	adobe["ecircumflex"] = 292
X	adobe["edieresis"] = 293
X	adobe["egrave"] = 294
X	adobe["iacute"] = 295
X	adobe["icircumflex"] = 296
X	adobe["idieresis"] = 297
X	adobe["igrave"] = 298
X	adobe["ntilde"] = 299
X	adobe["oacute"] = 300
X	adobe["ocircumflex"] = 301
X	adobe["odieresis"] = 302
X	adobe["ograve"] = 303
X	adobe["otilde"] = 304
X	adobe["scaron"] = 305
X	adobe["uacute"] = 306
X	adobe["ucircumflex"] = 307
X	adobe["udieresis"] = 308
X	adobe["ugrave"] = 309
X	adobe["ydieresis"] = 310
X	adobe["zcaron"] = 311
X
X#  Extra characters in the X-character set that are not in
X#  the NeWS character set.
X
X	adobe["Eth"] =  320
X	adobe["Thorn"] =  321
X	adobe["Yacute"] =  322
X	adobe["brokenbar"] =  323
X	adobe["copyright"] =  324
X	adobe["degree"] =  325
X	adobe["divide"] =  326
X	adobe["eth"] =  327
X	adobe["logicalnot"] =  328
X	adobe["minus"] =  329
X	adobe["mu"] =  330
X	adobe["multiply"] =  331
X	adobe["onesuperior"] =  332
X	adobe["plusminus"] =  333
X	adobe["registered"] =  334
X	adobe["thorn"] =  335
X	adobe["threesuperior"] =  336
X	adobe["trademark"] =  337
X	adobe["twosuperior"] =  338
X	adobe["yacute"] =  339
X
X# family is a mapping from the BDF character set name to the
X#	troff name
X
X	family["CourierBoldO"] = "CD"
X	family["CourierBoldR"] = "CB"
X	family["CourierMediumO"] = "CO"
X	family["CourierMediumR"] = "C"
X	family["HelveticaBoldO"] = "HD"
X	family["HelveticaBoldR"] = "HB"
X	family["HelveticaMediumO"] = "HO"
X	family["HelveticaMediumR"] = "H"
X	family["New Century SchoolbookBoldI"] = "ND"
X	family["New Century SchoolbookBoldR"] = "NB"
X	family["New Century SchoolbookMediumI"] = "NI"
X	family["New Century SchoolbookMediumR"] = "N"
X	family["TimesBoldI"] = "BI"
X	family["TimesBoldR"] = "B"
X	family["TimesMediumI"] = "I"
X	family["TimesMediumR"] = "R"
X	family["SymbolMediumR"] = "S"
X}
X
X# change font sequence
X# FONT -Adobe-Times-Bold-R-Normal--8-80-75-75-P-47-ISO8859-1
X# new name is something like
X# devpsc.r.8.75
X
X/^FONT / {
X	n = split($0, arg, "-")
X	charset = arg[3] arg[4] arg[5]
X	if (length(family[charset]) == 0) {
X		unknown = 1
X		print $0
X		next
X	}
X	print "COMMENT", $0
X	print "FONT devpsc." family[charset] "." arg[8] "." arg[10]
X	if (arg[3] == "Symbol")
X		symbol = 1
X	next
X}
X
X# CHARSET_REGISTRY "ISO8859"
X/^CHARSET_REGISTRY / {
X	if (unknown || symbol)
X		print
X	else
X		printf "CHARSET_REGISTRY \"PostScript\"\n"
X	next
X}
X
X# CHARSET_COLLECTIONS "ASCII ISOLATIN1 ADOBESTANDARD"
X/^CHARSET_COLLECTIONS / {
X	if (unknown || symbol)
X		print
X	else
X		printf "CHARSET_COLLECTIONS \"ASCII POSTSCRIPT ADOBESTANDARD\"\n"
X	next
X}
X
X# COPYRIGHT "Copyright (c) 1984, 1987 Adobe Systems, Inc., Portions Copyright 1988 Digital Equipment Corp."
X/^COPYRIGHT / {
X	if (unknown || symbol)
X		print
X	else {
X		printf "COPYRIGHT \"Copyright (c) 1984, 1987 Adobe Systems, Inc., "
X		printf "Portions Copyright 1988 Digital Equipment Corp., "
X		printf "Portions Copyright 1988 Cray Research, Inc.\"\n"
X	}
X	next
X}
X
X# set character name
X
X/^STARTCHAR .*/ {
X	name = $2
X	print
X	next
X}
X
X# change ENCODING to PostScript encoding
X
X/^ENCODING .*/ {
X	if (unknown || symbol) {
X		print
X		next
X	}
X	if (length(code = adobe[name]) == 0)	# if character not standard
X		code = -1
X	print "ENCODING", code
X	next
X}
X
X# other lines
X
X{ print }
X
XEND { }
END_OF_FILE
if test 7712 -ne `wc -c <'xtroff/xfonts/adobe.awk'`; then
    echo shar: \"'xtroff/xfonts/adobe.awk'\" unpacked with wrong size!
fi
# end of 'xtroff/xfonts/adobe.awk'
fi
echo shar: End of archive 8 \(of 18\).
cp /dev/null ark8isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 ; do
    if test ! -f ark${I}isdone ; then
	MISSING="${MISSING} ${I}"
    fi
done
if test "${MISSING}" = "" ; then
    echo You have unpacked all 18 archives.
    rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
    echo You still need to unpack the following archives:
    echo "        " ${MISSING}
fi
##  End of shell archive.
exit 0



More information about the Comp.sources.x mailing list