root2@pcrat.UUCP (09/18/88)
Posting-number: Volume 4, Issue 73 Submitted-by: "A. Nonymous" <root2@pcrat.UUCP> Archive-name: jetroff/src/Part04 #! /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 4 (of 7)." # Contents: djet/convert.c djet/device.c djet/jetroff.sh # djet/jetroff_bm.c doc/djet.1 doc/fontlist.5 doc/jetroff.1 # font/devjet/fontlist font/mkfont/readdesc.c # Wrapped by rick@pcroe on Sat Aug 27 13:01:08 1988 PATH=/bin:/usr/bin:/usr/ucb ; export PATH if test -f 'djet/convert.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'djet/convert.c'\" else echo shar: Extracting \"'djet/convert.c'\" \(4527 characters\) sed "s/^X//" >'djet/convert.c' <<'END_OF_FILE' X/*c X * JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II X * X * Copyright (c) 1988 PC Research, Inc. All Rights Reserved. X * X * This source code is supplied to you under the terms of the X * contents of the "License" agreement found with this source X * distribution. You must read the "License" before you use X * this source code in any way. X * Xc*/ X X/* X * $Id: convert.c,v 1.1 88/08/26 23:10:50 rick Exp $ X * X * $Log: convert.c,v $ X * Revision 1.1 88/08/26 23:10:50 rick X * Initial revision X * X */ X#ifndef lint Xstatic char rcsid[] = "@(#) $Id: convert.c,v 1.1 88/08/26 23:10:50 rick Exp $"; X#endif X X#include <stdio.h> X X#include "dlj.h" X Xconvert() X{ X register int c; X int n; X char buf[512]; X X LineNumber = 1; X PageNumber = 1; X X while ((c = getchar()) != EOF) X { X switch (c) X { X case 's': /* Point size */ X (void) scanf("%d", &PointSize); X if (PointSize < 1 || PointSize > 99) X { X error(0, "Insane Point Size: %d", X PointSize); X PointSize = 10; X } X break; X case 'f': /* Font Number */ X (void) scanf("%d", &FontNumber); X break; X case 'c': /* Single ASCII Character */ X put_ascii(getchar()); X break; X case 'C': /* Special character */ X (void) scanf("%s", buf); X put_special(buf); X break; X case 'H': /* Absolute Horizontal Motion */ X (void) scanf("%d", &TroffX); X break; X case 'h': /* Relative Horizontal Motion */ X (void) scanf("%d", &n); X TroffX += n; X break; X case 'V': /* Absolute Vertical Motion */ X (void) scanf("%d", &TroffY); X break; X case 'v': /* Relative Vertical Motion */ X (void) scanf("%d", &n); X TroffY += n; X break; X case '0': case '1': case '2': case '3': case '4': X case '5': case '6': case '7': case '8': case '9': X /* Rel move + character */ X n = (c - '0') * 10 + (getchar() - '0'); X TroffX += n; X put_ascii(getchar()); X break; X case 'n': /* End of line reached */ X while ( (c=getchar()) != '\n' && c != EOF) {} X ++LineNumber; X TroffX = 0; X break; X case 'w': /* New Word */ X break; X case 'p': /* New Page */ X (void) scanf("%d", &n); X new_page(n); X break; X case '#': /* Comment */ X while ( (c=getchar()) != '\n' && c != EOF) {} X ++LineNumber; X break; X case 'D': /* Drawing */ X drawing(); X break; X case 'x': /* Device */ X device(); X break; X case '\n': X ++LineNumber; X break; X default: X error(1, "Unrecognized ditroff command %c", c); X break; X } X } X draw_output(); X pk_endpage(); X} X Xdrawing() X{ X char buf[512]; X X (void) fgets(buf, sizeof(buf), stdin); X switch (buf[0]) X { X case 'l': /* Draw a line */ X { X int rx, ry; X (void) sscanf(&buf[1], "%d %d", &rx, &ry); X draw_line(TroffX, TroffY, TroffX+rx, TroffY+ry); X TroffX += rx; X TroffY += ry; X } X break; X case 'c': /* Draw a circle */ X { X int diam; X (void) sscanf(&buf[1], "%d", &diam); X draw_circle(TroffX, TroffY, diam); X TroffX += diam; X } X break; X case 'e': /* Draw an ellipse */ X { X int diamx, diamy; X (void) sscanf(&buf[1], "%d %d", &diamx, &diamy); X draw_ellipse(TroffX, TroffY, diamx, diamy); X TroffX += diamx; X } X break; X case 'a': /* Draw an arc */ X { X int dx1, dy1; X int dx2, dy2; X (void) sscanf(&buf[1], "%d %d %d %d", X &dx1, &dy1, &dx2, &dy2); X draw_arc(TroffX, TroffY, dx1, dy1, dx2, dy2); X TroffX += dx1 + dx2; X TroffY += dy1 + dy2; X } X break; X case '~': /* Draw a B-spline */ X draw_spline(TroffX, TroffY, &buf[1]); X break; X default: X error(1, "Unrecognized ditroff command D%c", buf[0]); X break; X } X ++LineNumber; X} X Xdevice() X{ X register int c; X char buf[512]; X X (void) scanf("%s", buf); X switch (buf[0]) X { X case 'i': /* Initialize device */ X device_init(); X break; X case 'T': /* Typesetter name */ X (void) scanf("%s", buf); X device_name(buf); X break; X case 'r': /* Typsetter resolution */ X { X int dpi, xmove, ymove; X (void) scanf("%d %d %d", &dpi, &xmove, &ymove); X device_resolution(dpi, xmove, ymove); X } X break; X case 'p': /* Pause */ X device_pause(); X break; X case 's': /* Stop */ X device_stop(); X break; X case 't': /* Trailer */ X break; X case 'f': /* Font */ X { X int num; X (void) scanf("%d %s", &num, buf); X if (num < 0 || num > DESC_dev.nfonts) X error(1, "Font number %d out of range (0-%d)", X num, DESC_dev.nfonts); X FontMap[num] = load_font(buf); X } X break; X case 'b': /* Bitmap */ X bitmap(); X break; X case 'H': /* Height */ X break; X case 'S': /* Slant */ X break; X default: X error(1, "Unrecognized ditroff command x %s", buf); X break; X } X while ( (c=getchar()) != '\n' && c != EOF) {} X ++LineNumber; X} END_OF_FILE if test 4527 -ne `wc -c <'djet/convert.c'`; then echo shar: \"'djet/convert.c'\" unpacked with wrong size! fi # end of 'djet/convert.c' fi if test -f 'djet/device.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'djet/device.c'\" else echo shar: Extracting \"'djet/device.c'\" \(6622 characters\) sed "s/^X//" >'djet/device.c' <<'END_OF_FILE' X/*c X * JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II X * X * Copyright (c) 1988 PC Research, Inc. All Rights Reserved. X * X * This source code is supplied to you under the terms of the X * contents of the "License" agreement found with this source X * distribution. You must read the "License" before you use X * this source code in any way. X * Xc*/ X X/* X * $Id: device.c,v 1.1 88/08/26 23:10:53 rick Exp $ X * X * $Log: device.c,v $ X * Revision 1.1 88/08/26 23:10:53 rick X * Initial revision X * X */ X#ifndef lint Xstatic char rcsid[] = "@(#) $Id: device.c,v 1.1 88/08/26 23:10:53 rick Exp $"; X#endif X X#include <stdio.h> X#include "dlj.h" X#include "paths.h" X Xdevice_init() X{ X read_DESC(); X hp_init(); X} X X/* ARGSUSED */ Xdevice_name(buf) Xchar *buf; X{ X} X X/* ARGSUSED */ Xdevice_resolution(dpi, xmove, ymove) X{ X} X X/* ARGSUSED */ Xnew_page(pageno) X{ X static int firstpage = 1; X X if (firstpage) X { X firstpage = 0; X LandOffset = 0; X LandPageNumber = 0; X } X else X { X draw_output(); X pk_endpage(); X if (Landscape) X { X if (++LandPageNumber == LandPages) X { X LandPageNumber = 0; X LandOffset = 0; X (void) putc('\f', stdout); X } X else X { X LandOffset += LandWidth/LandPages; X } X } X else X (void) putc('\f', stdout); X PageNumber++; X } X TroffX = TroffY = 0; X# ifdef COMMERCIAL X if (demo) X demo_notice(); X# endif X hp_is_at(-30000, -30000); X draw_init(); X} X Xdevice_stop() X{ X} X Xdevice_pause() X{ X esc("&l2H"); X} X Xvoid *Malloc(size, abort) Xunsigned size; X{ X /* X * Can't win: we have void *malloc(), but our lint library doesn't! X */ X register char *p = (char *) malloc( (unsigned) size); X X if (!p && abort) error(1, "Can't get space"); X X# if lint X return ((void *) 0); X# else X return ((void *) p); X# endif X} X Xvoid Free(p) Xchar *p; X{ X if (p == NULL) error(0, "tried to free NULL"); X (void)free(p); X} X Xread_DESC() X{ X char desc_name[128+15]; X register unsigned int b; X register int fd; X X Sprintf(desc_name, "%s/DESC.out", FontDir); X fd = open(desc_name, 0); X if (fd < 0) X error(1, "Can't open typesetter %s", desc_name); X if (read(fd, (char *) &DESC_dev, sizeof(DESC_dev)) != sizeof(DESC_dev)) X error(1, "Trouble reading %s", desc_name); X DESC_sizes = (short *) Malloc(b = (DESC_dev.nsizes+1)*sizeof(short), 1); X if (read(fd, (char *) DESC_sizes, b) != b) X error(1, "Trouble reading %s", desc_name); X DESC_funny_index = (short *) Malloc(b=DESC_dev.nchtab*sizeof(short), 1); X if (read(fd, (char *) DESC_funny_index, b) != b) X error(1, "Trouble reading %s", desc_name); X DESC_funny_names = (char *) Malloc(b = DESC_dev.lchname*sizeof(char),1); X if (read(fd, DESC_funny_names, b) != b) X error(1, "Trouble reading %s", desc_name); X (void) close(fd); X} X Xload_font(name) Xchar *name; X{ X char font_path[128+15]; X register int b; X int s; X int fd; X FILE *fp; X register int n; X X for (n = 0; n < NFont; ++n) X if (strcmp(name, Font[n].font_info->namefont) == 0) X return (n); /* Already have info */ X X if (NFont >= NFONT) X error(1, "Tried to use more than %d fonts\n", NFONT); X else X n = NFont++; X X Sprintf(font_path, "%s/%s.out", FontDir, name); X fd = open(font_path, 0); X if (fd < 0) X { X error(0, "Can't open font %s", font_path); X return (1); X } X b = sizeof(FONT) + 3*256 + 96 + DESC_dev.nchtab; X Font[n].font_info = (FONT *) Malloc( (unsigned) b, 1); X if (read(fd, (char *) Font[n].font_info, (unsigned int) b) <= 0) X error(0, "trouble reading '%s'", font_path); X (void) close(fd); X X b = (uchar) Font[n].font_info->nwfont; X Font[n].width_table = (uchar *)Font[n].font_info + sizeof(FONT); X Font[n].kern_table = (uchar *)Font[n].font_info X + b*sizeof(char) + sizeof(FONT); X Font[n].code_table = (uchar *)Font[n].font_info X + 2*b*sizeof(char) + sizeof(FONT); X Font[n].font_index = (uchar *)Font[n].font_info X + 3*b*sizeof(char) + sizeof(FONT); X if (debug) X { X Fprintf(stderr, X "File %s, Font %s (internal name %s) mounted on %d\n", X name, Font[n].font_info->namefont, X Font[n].font_info->intname, n); X } X /* X * Read available sizes X */ X Sprintf(font_path, "%s/%s.SZ", FontDir, name); X fp = fopen(font_path, "r"); X if (!fp) X error(1, "Couldn't get size info for %s", name); X if (fscanf(fp, "%s", Font[n].tex_name) != 1) X error(1, "Bad size file format '%s'", name); X for (b = 0; fscanf(fp, "%d", &s) == 1; ++b) X { X Font[n].sizes[b] = s; X Font[n].id[b] = -1; X } X Font[n].sizes[b] = 9999; X Font[n].id[b] = -1; X (void) fclose(fp); X return (n); X} X Xput_ascii(c) X{ X if (debug) X { X Fprintf(stderr, "Ascii '%c', Font %d, Size %d, at (%d,%d)\n", X c, FontNumber, PointSize, TroffX, TroffY); X } X put_code(c); X} X Xput_special(s) Xchar *s; X{ X register int i; X X if (debug) X { X Fprintf(stderr,"Special \"%s\", Font %d, Size %d, at (%d,%d)\n", X s, FontNumber, PointSize, TroffX, TroffY); X } X for (i = 0; i < DESC_dev.nchtab; ++i) X if (strcmp(&DESC_funny_names[DESC_funny_index[i]], s) == 0) X { X put_code(i + 128); X return; X } X} X Xput_code(c) X{ X register int index, i; X register int fontn; X int sizeindex; X int advance; X X if (c < 32) X { X error(0, "Unknown character code 0x%02x", c); X return; X } X else if (c == 32) X return; /* SPACE */ X c -= 32; X fontn = FontMap[FontNumber]; X index = Font[fontn].font_index[c]; X if (index == 0) X { X if (debug) X Fprintf(stderr, X "Code %d not on font %d\n", c, FontNumber); X /* X * Try to find it on special X */ X for (i = 0; !index && i < DESC_dev.nfonts; ) X { X ++i; X if (Font[FontMap[i]].font_info->specfont) X index = Font[FontMap[i]].font_index[c]; X } X /* X * Try any damn font at all X */ X if (!index) for (i = 0; !index && i < DESC_dev.nfonts;) X { X ++i; X index = Font[FontMap[i]].font_index[c]; X } X if (debug) X { X if (!index) X Fprintf(stderr, X "Code %d not on font %d\n", c, FontNumber); X else X Fprintf(stderr, X "Code %d found on font %d\n", c, i); X } X if (index) fontn = FontMap[i]; else return; X } X /* X * fontn is index into Font[] X */ X sizeindex = size_index(fontn); X if (Font[fontn].id[sizeindex] == -1) X Font[fontn].id[sizeindex] = X pk_open(Font[fontn].tex_name, X Font[fontn].sizes[sizeindex], 300); X if (Font[fontn].id[sizeindex] == -1) X error(1, "Bitmap for font '%s', size %d has disappeared!", X Font[fontn].font_info->namefont, X Font[fontn].sizes[sizeindex]); X hp_pos(TroffX, TroffY); X if (debug) X Fprintf(stderr, X "Download raster %d, glyph %d\n", X Font[fontn].id[sizeindex], X Font[fontn].code_table[index]); X advance = pk_download(Font[fontn].id[sizeindex], X (int) Font[fontn].code_table[index], stdout); X hp_is_at(TroffX + advance, TroffY); X} X Xsize_index(fontn) X{ X register int i; X X for (i = 0; Font[fontn].sizes[i] <= PointSize; ++i) X {} X return i - 1; X} END_OF_FILE if test 6622 -ne `wc -c <'djet/device.c'`; then echo shar: \"'djet/device.c'\" unpacked with wrong size! fi # end of 'djet/device.c' fi if test -f 'djet/jetroff.sh' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'djet/jetroff.sh'\" else echo shar: Extracting \"'djet/jetroff.sh'\" \(5791 characters\) sed "s/^X//" >'djet/jetroff.sh' <<'END_OF_FILE' X#/*c X# * JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II X# * X# * Copyright (c) 1988 PC Research, Inc. All Rights Reserved. X# * X# * This source code is supplied to you under the terms of the X# * contents of the "License" agreement found with this source X# * distribution. You must read the "License" before you use X# * this source code in any way. X# * X#c*/ X X# X# $Id: jetroff.sh,v 1.1 88/08/26 23:10:58 rick Exp $ X# X# $Log: jetroff.sh,v $ X# Revision 1.1 88/08/26 23:10:58 rick X# Initial revision X# X# X XJETSCAN=${JETSCAN:-1} # Enable scan for needed preprocessors X Xusage() { X echo "Usage: jetroff [-p -t -e -g -b]" X echo " [-oLIST -nN -sN -mXX -rR# -i -q -z -a]" X echo " [-Ffontdir -Rrastdir -cN -dDEST -S] files ..." X echo X echo " -p -e -t -g Preprocess with pic, eqn, tbl, and/or grap" X echo " -b Include bitmap inclusion macros" X echo " -oLIST Print only pages in LIST" X echo " -nN Number first page with number N" X echo " -sN Stop (pause) every N pages" X echo " -mXX Include the XX macros (/usr/lib/tmax/tmac.XX)" X echo " -rR# Set register r (a one character name) to #" X echo " -i Read standard input after all other files" X echo " -q Invoke simultaneous IO mode of the .rd request" X echo " -z Print only messages generated by .tm requests" X echo " -a Send a crude ASCII approximation to terminal" X echo " -Ffontdir Search for the fonts in fontdir" X echo " -Rrastdir Search for the rasters in rastdir" X echo " -cN Have the printer generate N copies (max 99)" X echo " -dDEST Change printer destination to DEST (- is stdout)" X echo " -lN[:W] Landscape, N pages/sheet, W is sheet width" X echo " -S Print document statistics to stderr" X echo " -h -? Print this usage message" X echo "More? \c" X read yn </dev/tty X if [ "Q$yn" = Qn ] X then X return 0; X fi X echo X echo "Example: jetroff -mm mymemo.mm" X echo "Example: jetroff -man manpage.man" X echo "Example: jetroff -b -mm bitmaps.mm" X echo X echo "The need for the -e, -t, -p, -g, and -b flags are determined" X echo "automatically by jetroff by scanning the document. The flags" X echo "are provided for those cases where jetroff cannot determine" X echo "a need for these flags, usually because the document includes" X echo ".so (include file) requests." X} X Xset -- `getopt h?o:n:s:m:r:iqzaF:R:c:d:l:SbptegP4 $*` Xif [ $? != 0 ]; then usage; exit 2; fi X Xpiped=2 Xcat= Xeqn= Xpic= Xgrap= Xtbl= Xbackup= Xtroff="troff -Tjet" # Troff command Xtroff_opts= # Troff options Xdjet=djet # djet postprocessor Xdjet_opts= # djet options Xlp=lp # line printer spooler Xlp_opts=-otroff # spooler options (raw output, no CR/NL mapping) Xpid=$$ X Xfor i in $* Xdo X case $i in X -m) X if [ "Q$2" = Qanual ] X then X # Special help for -manual (PCR local) X if [ "Q$backup" != Q ] X then X djet_opts="$djet_opts -l2:14i"; X fi X troff_opts="$troff_opts -rs1"; X fi X troff_opts="$troff_opts $i$2"; X shift 2; X ;; X -4) X # Special help for 4 on 1 output (PCR local) X djet_opts="$djet_opts -l1:14i"; X backup="jetbackup -b"; X shift; X ;; X -o|-n|-s|-r) X troff_opts="$troff_opts $i$2"; shift 2;; X -i|-q|-z) X troff_opts="$troff_opts $i"; shift;; X -a) X troff_opts="$troff_opts $i"; shift; djet=; lp=;; X -F) X troff_opts="$troff_opts $i$2"; X djet_opts="$djet_opts $i$2/devjet"; X shift 2;; X -R|-c|-l) X djet_opts="$djet_opts $i$2"; shift 2;; X -d) X if [ "Q$2" = Q- ]; then lp=; X else lp_opts="$lp_opts $i$2"; fi X shift 2;; X -S) X djet_opts="$djet_opts $i"; shift;; X -b) X troff_opts="$troff_opts -mjetroff"; shift;; X -p) X pic=pic; cat=cat; shift;; X -e) X eqn=eqn; cat=cat; shift;; X -t) X tbl=tbl; cat=cat; shift;; X -g) X grap=grap; pic=pic; cat=cat; shift;; X -P) X piped=`expr $piped - 1`; shift;; X --) X shift; break;; X -h|-?) X usage; exit 0;; X esac Xdone Xfiles="$*" X Xif [ "Q$JETSCAN" = Q1 ] Xthen X for i in `jetcheck $files` X do X case $i in X -p) X pic=pic; cat=cat;; X -e) X eqn=eqn; cat=cat;; X -t) X tbl=tbl; cat=cat;; X -g) X grap=grap; pic=pic; cat=cat;; X -b) X troff_opts="$troff_opts -mjetroff"; shift;; X esac X done Xfi X Xcmd= Xif [ $piped = 2 ] Xthen X if [ "$cat" != "" ]; then cmd="$cat $files | "; files=; fi X if [ "$grap" != "" ]; then cmd="$cmd $grap | "; fi X if [ "$pic" != "" ]; then cmd="$cmd $pic | "; fi X if [ "$tbl" != "" ]; then cmd="$cmd $tbl | "; fi X if [ "$eqn" != "" ]; then cmd="$cmd $eqn | "; fi X cmd="$cmd $troff $troff_opts $files" X if [ "$djet" != "" ]; then cmd="$cmd | $djet $djet_opts"; fi X if [ "$backup" != "" ]; then cmd="$cmd | $backup"; fi X if [ "$lp" != "" ]; then cmd="$cmd | $lp $lp_opts"; fi Xelse X if [ $piped = 0 ]; then pid=; fi X to= X fn=0 X if [ "$cat" != "" ]; then cmd="$cat $files | "; files=; fi X if [ "$grap" != "" ] X then X if [ "$to" != "" ]; then ti="<$to"; else ti=; fi X fn=`expr $fn + 1`; to="/tmp/JET$pid.$fn" X cmd="$cmd $grap $ti >$to;"; X fi X if [ "$pic" != "" ] X then X if [ "$to" != "" ]; then ti="<$to"; else ti=; fi X fn=`expr $fn + 1`; to="/tmp/JET$pid.$fn" X cmd="$cmd $pic $ti >$to;"; X fi X if [ "$tbl" != "" ] X then X if [ "$to" != "" ]; then ti="<$to"; else ti=; fi X fn=`expr $fn + 1`; to="/tmp/JET$pid.$fn" X cmd="$cmd $tbl $ti >$to;"; X fi X if [ "$eqn" != "" ] X then X if [ "$to" != "" ]; then ti="<$to"; else ti=; fi X fn=`expr $fn + 1`; to="/tmp/JET$pid.$fn" X cmd="$cmd $eqn $ti >$to;"; X fi X if [ "$to" != "" ]; then ti="<$to"; else ti=; fi X fn=`expr $fn + 1`; to="/tmp/JET$pid.$fn" X cmd="$cmd $troff $troff_opts $files $ti >$to" X if [ "$djet" != "" ] X then X ti="<$to" X cmd="$cmd; $djet $djet_opts $ti" X fi X if [ "$backup" != "" ]; then cmd="$cmd | $backup"; fi X if [ "$lp" != "" ]; then cmd="$cmd | $lp $lp_opts"; fi Xfi Xeval $cmd Xif [ $piped = 1 ] Xthen X i=1 X while [ $i -le $fn ] X do X rm /tmp/JET$pid.$i X i=`expr $i + 1` X done Xfi Xexit 0 X# undocumented -P (and -P -P) option for 386/ix floating point X# bug (can't have two procs doing fp at same time). END_OF_FILE if test 5791 -ne `wc -c <'djet/jetroff.sh'`; then echo shar: \"'djet/jetroff.sh'\" unpacked with wrong size! fi chmod +x 'djet/jetroff.sh' # end of 'djet/jetroff.sh' fi if test -f 'djet/jetroff_bm.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'djet/jetroff_bm.c'\" else echo shar: Extracting \"'djet/jetroff_bm.c'\" \(6006 characters\) sed "s/^X//" >'djet/jetroff_bm.c' <<'END_OF_FILE' X/*c X * JetRoff - DWB 2.0 postprocessor for HP LaserJet Series II X * X * Copyright (c) 1988 PC Research, Inc. All Rights Reserved. X * X * This source code is supplied to you under the terms of the X * contents of the "License" agreement found with this source X * distribution. You must read the "License" before you use X * this source code in any way. X * Xc*/ X Xstatic char Copyright[] = X"@(#) JetRoff (c) Copyright 1988 PC Research, Inc. All Rights Reserved."; X X/* X * $Id: jetroff_bm.c,v 1.1 88/08/26 23:10:59 rick Exp $ X * X * $Log: jetroff_bm.c,v $ X * Revision 1.1 88/08/26 23:10:59 rick X * Initial revision X * X */ X#ifndef lint Xstatic char rcsid[] = "@(#) $Id: jetroff_bm.c,v 1.1 88/08/26 23:10:59 rick Exp $"; X#endif X X#include <stdio.h> X#include <string.h> X X#define Printf (void) printf Xextern void exit(); X X/* X * jetroff_bm file type res just curx cury indent X * X * just: L, R, C, LF (flows) RF (flows) X */ Xint debug = 0; X Xchar *argname[] = X{ X "prog", "file", "type", "res", "just", "curx", "cury", X "indent", "offset", "ll", "vs", "divert" X}; X Xchar *argv0; X Xmain(argc, argv) Xint argc; Xchar *argv[]; X{ X char *file = argv[1]; X char *type = argv[2]; X int res = atoi(argv[3]); X char *just = argv[4]; X int curx = atoi(argv[5]); X int cury = atoi(argv[6]); X int indent = atoi(argv[7]); X int offset = atoi(argv[8]); X int ll = atoi(argv[9]); X int vs = atoi(argv[10]); X char *diversion = argv[11]; X char *delay = ""; X char *trans = ""; X char *xoffset = ""; X char *yoffset = ""; X int flows; X int overlays; X int bm_width; X int bm_height; X int border = 0/*300/16*/; X X# ifdef lint X flows = cury; X flows = indent; X flows = offset; X# endif X X argv0 = argv[0]; X X if (debug) X { X int i; X for (i = 0; i < argc; ++i) X (void) fprintf(stderr, "ARG[%d] (%s) = '%s'\n", X i, i <= 11 ? argname[i] : "?", argv[i]); X } X X if (res != 75 && res != 100 && res != 150 && res != 300) X { X error(256, X ".BM: Illegal resolution %d; try 75, 100, 150, or 300", X res); X } X X if (strcmp(type, "test") == 0) X { X (void) sscanf(file, "%dx%d", &bm_width, &bm_height); X bm_width = bm_width*300/res; X bm_height = bm_height*300/res; X } X else X { X FILE *fp; X char *p; X extern char *malloc(); X extern void free(); X extern FILE *popen(); X X p = (char *) malloc( (unsigned) strlen(type)+strlen(file)+16); X if (!p) X error(256, "out of memory"); X (void) sprintf(p, "%s -S %s", type, file); X fp = popen(p, "r"); X if (!fp) X { X error(256, ".BM: I don't know '%s' bitmap format", X type); X exit(0); X } X bm_width = getw(fp) * 300/res; X bm_height = getw(fp) * 300/res; X (void) pclose(fp); X (void) free(p); X } X X if (just[1] == 'j' || just[1] == 'J') X flows = 1; X else X flows = 0; X if (just[1] == 'o' || just[1] == 'O') X overlays = 1; X else X overlays = 0; X X if (strchr(just, '(')) X { X char *b; X char *e; X X b = strchr(just, '(') + 1; X if (!*b) error(256, ".BM: incomplete offset info '%s'", just); X e = strchr(b, ','); X if (!e) error(256, ".BM: incomplete offset info '%s'", just); X *e = 0; X xoffset = b; X b = ++e; X if (!*b) error(256, ".BM: incomplete offset info '%s'", just); X e = strchr(b, ')'); X if (!e) error(256, ".BM: incomplete offset info '%s'", just); X *e = 0; X yoffset = b; X } X X if (diversion[0]) X { delay = "\\"; trans = "\\!"; } X X switch (just[0]) X { X case 'l': case 'L': X if (!flows) Printf(".br\n"); X Printf(".ne %du%s\n", bm_height+border, yoffset); X Printf("%s.nr %%x %s\\n(.o+%s\\n(.i+%du%s \n", X trans, delay, delay, 0/*indent*/, xoffset); X Printf("%s.nr %%y %s\\n(.d+%d%s \n", X trans, delay, (curx ? vs : 0) + border, yoffset); X if (flows) X { X if (*xoffset) X Printf("'in +(%du%s)\n", X bm_width+border, xoffset); X else X Printf("'in +%du\n", bm_width+border); X Printf(".de #L\n"); X Printf(".rm #L\n"); X Printf("%s \\n(.du+%du+%du%s\n", X diversion[0] ? ".dt" : ".wh", X (curx ? vs+border : border), X bm_height, yoffset); X if (*xoffset) X Printf("'in -(%du%s)\n", X bm_width+border, xoffset); X else X Printf("'in -%du\n", bm_width+border); X Printf("..\n"); X Printf("%s \\n(.du+%du+%du #L\n", X diversion[0] ? ".dt" : ".wh", X (curx ? vs+border : border), X bm_height, yoffset); X } X else if (!overlays) X { X Printf(".rs\n"); X Printf(".sp %du%s\n", bm_height+border, yoffset); X } X Printf( X "%s\\!x bitmap \"%s\" \"%s\" %d \"%s\" %s\\n(%%x %s\\n(%%y\n", X trans, file, type, res, just, delay, delay); X break; X case 'r': case 'R': X if (!flows) Printf(".br\n"); X Printf(".ne %du%s\n", bm_height+border, yoffset); X Printf("%s.nr %%x %s\\n(.o+%du%s \n", X trans, delay, ll-bm_width, xoffset); X Printf("%s.nr %%y %s\\n(.d+%d%s \n", X trans, delay, (curx ? vs : 0) + border, yoffset); X if (flows) X { X Printf("'ll -%du%s\n", bm_width+border, xoffset); X Printf(".de #R\n"); X Printf(".rm #R\n"); X Printf("%s \\n(.du+%du+%du%s\n", X diversion[0] ? ".dt" : ".wh", X (curx ? vs+border : border), X bm_height, yoffset); X Printf("'ll +%du%s\n", bm_width+border, xoffset); X Printf("..\n"); X Printf("%s \\n(.du+%du+%du%s #R\n", X diversion[0] ? ".dt" : ".wh", X (curx ? vs+border : border), X bm_height, yoffset); X } X else if (!overlays) X { X Printf(".rs\n"); X Printf(".sp %du%s\n", bm_height+border, yoffset); X } X Printf( X "%s\\!x bitmap \"%s\" \"%s\" %d \"%s\" %s\\n(%%x %s\\n(%%y\n", X trans, file, type, res, just, delay, delay); X break; X case 'c': case 'C': X Printf(".br\n"); X Printf(".ne %du%s\n", bm_height+border, yoffset); X Printf("%s.nr %%x %s\\n(.o+%s\\n(.i+%du%s \n", X trans, delay, delay, (ll-bm_width)/2, xoffset); X Printf("%s.nr %%y %s\\n(.d+%d%s \n", X trans, delay, (curx ? vs : 0) + border, yoffset); X if (!overlays) X { X Printf(".rs\n"); X Printf(".sp %du%s\n", bm_height+border, yoffset); X } X Printf( X "%s\\!x bitmap \"%s\" \"%s\" %d \"%s\" %s\\n(%%x %s\\n(%%y\n", X trans, file, type, res, just, delay, delay); X break; X default: X error(256, X ".BM: Unknown position '%s'; try L, R, C, LJ, RJ, LO, CO, or RO", X just[0]); X } X exit(0); X /* NOTREACHED */ X} END_OF_FILE if test 6006 -ne `wc -c <'djet/jetroff_bm.c'`; then echo shar: \"'djet/jetroff_bm.c'\" unpacked with wrong size! fi # end of 'djet/jetroff_bm.c' fi if test -f 'doc/djet.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/djet.1'\" else echo shar: Extracting \"'doc/djet.1'\" \(4559 characters\) sed "s/^X//" >'doc/djet.1' <<'END_OF_FILE' X.TH djet 1 "PC Research, Inc." "JetRoff" X.SH NAME Xdjet \- Device independent troff to HP LaserJet Series II printers X.SH SYNOPSIS X\fBdjet [-I\fIcode\fP -F\fIfontdir\fB -R\fIrastdir\fB -c\fIN\fB X-l\fIN\fP[:\fIW\fP] -S]\fR X.SH DESCRIPTION X\fIdjet\fP converts the device independent output of \fItroff\fP(1) Xinto Hewlett Packard PCL (printer command language) suitable for Xdriving an HP LaserJet Series II printer. XThe input is read from standard input; PCL is written to standard Xoutput. Any error messages are displayed on standard error. XThe following options are available: X.IP \fB-F\fP\fIfontdir\fP .5i XLook for the font description files in \fIfontdir\fP instead Xof \fB/usr/lib/font/devjet\fP. X.IP \fB-R\fP\fIrastdir\fP .5i XLook for the font raster files in \fIrastdir\fP instead Xof \fB/usr/lib/font/devjet/pk\fP. X.IP \fB-c\fP\fIN\fP .5i XPrint \fIN\fP copies of each page (maximum of 99). X.IP \fB-l\fP\fIN[:W]\fP .5i XPrint in landscape orientation, with \fIN\fP logical pages printed Xon each physical page. \fIW\fP specifies the width of the paper X(default 11i). X.IP \fB-S\fP .5i XPrint postprocessor statistics. X.SH INSTALLATION XPrerequisites for installing \fIdjet\fP are AT&T's \fIDocumenter's XWorkbench 2.0\fP (DWB 2.0) and an HP LaserJet Series II printer. XDWB 2.0 is sold and supported by various UNIX software suppliers, Xsometimes under another name such as \fIText Preparation System\fP. X.P XIt is highly recommended that the printer be connected to your Xcomputer via the parallel interface. If a serial interface must Xbe used, the highest speed (19200 or 9600) should be chosen. X.P XEach \fIdjet\fP installation is limited to the site name for which Xit is licensed. Your license includes an `installation code' which Xenables \fIdjet\fP. If the code is incorrect or not present, X\fIdjet\fP will only operate in a demonstration mode. To get a Xcode you will have to call your software supplier with the name of Xyour site. You can get the name of your site with the following Xcommand: X.RS .5i X$ \fBuname -n\fP X.RE X.P XYour supplier will provide you with an installation \fIcode\fP. XHave your system administrator execute this command: X.RS .5i X# \fBdjet -I\fP\fIcode\fP X.RE X.SH FONTS X.P XFonts are downloaded to the printer as needed. Printer font cartridges Xneed not be present, and are not used. XThe following fonts are available: X X.ne 1i X.TS Xbox; Xlb | cb Xl | l. XName Character Set X_ XR \fRABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP XI \fIABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP XB \fBABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP XH \fHABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP XHI \f(HIABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP XHB \f(HBABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP XCW \f(CWABCDEFGHIJKLMN...abcdefghijklmnopqrstuvwxyz\fP X.TE X.PP XNot shown is font HD, a demibold font. XAll fonts are available in point sizes 4, 5, 6, 7, 8, 9, 10, 11, X12, 14, 16, 18, 20, 22, 24, 28, 32, 36, and 40. X.PP X.SH SPECIAL CHARACTERS XThe following characters are available on the so-called `Special Font'. XEach character is shown in 16 point type. Below them are the two Xletter names used by \fItroff\fP(1) to refer to them. Customized Xspecial characters and logos are available from PC Research. X.br X.ne 2i X.nf X.so djet.1.spec X.fi X.SH EXAMPLES X.P XA simple memo using the \fIMM\fP macros: X.RS X\f(CW$ troff -mm -Tjet memo.mm | djet | lp\fP X.RE X.P XThis time, three copies and with \fItbl\fP preprocessing: X.RS X\f(CW$ tbl memo.mm | troff -mm -Tjet | djet -c3 | lp\fP X.RE X.SH CAVEATS X.P X\fIdjet\fP makes a concerted effort to print all documents as requested; Xhowever, some documents are simply too complex for the LaserJet. No Xamount of additional HP memory can avoid these limitations. X.P XAlthough the number of font/size combinations which can be Xdownloaded is limited by the Xavailable memory of the LaserJet, no more than 16 font/size combinations Xmay be printed per page. XThe LaserJet will silently ignore further font requests on that page. XThis condition can only be cured by simplifying your document. X.P XSome \fIpic\fP(1) or \fIgrap\fP(1) output exceeds the capability of Xthe LaserJet to `rasterize' the picture. This condition will cause Xan ERROR 21 on the LaserJet, and only the first part of the page Xwill be printed. XThis condition can only be cured by simplifying your document. X.SH FILES X.IP \fB/usr/lib/font/devjet/*\fP 2i Xfont description tables, install.code X.IP \fB/usr/lib/font/devjet/pk/*\fP 2i Xfont packed raster files X.SH SEE ALSO Xtroff(1), jetroff(1), jetroff_bm(1), pcpaint(1) X.br X\fIDocumenters Workbench 2.0\fP END_OF_FILE if test 4559 -ne `wc -c <'doc/djet.1'`; then echo shar: \"'doc/djet.1'\" unpacked with wrong size! fi # end of 'doc/djet.1' fi if test -f 'doc/fontlist.5' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/fontlist.5'\" else echo shar: Extracting \"'doc/fontlist.5'\" \(4735 characters\) sed "s/^X//" >'doc/fontlist.5' <<'END_OF_FILE' X.TH fontlist 5 "PC Research, Inc." "JetRoff" X.SH NAME Xfontlist \- Format of font configuration file for \fImakeDESC(1)\fP X.SH SYNOPSIS X\fI/usr/lib/font/devjet/fontlist\fP X.SH DESCRIPTION X\fI/usr/lib/font/devjet/fontlist\fP contains a description of the Xfont configuration for JetRoff. This file plus the Xfont raster files themselves, are the only input needed to Xconfigure JetRoff's complement of available fonts. X.PP XThe file contains three types of lines. A comment line, which is Xignored, is any line that begins with the sharp character (#). X.PP XLines that begin with an alphabetic character describe fonts Xwhich should be included in the configuration. There are 7 fields Xon each of these lines. The fields are separated by any amount of whitespace. XThe first field is a one or two character name for the font to be Xused by \fItroff\fP. The second field is the prefix of the XMetafont style file name for the font. The actual font file is Xexpected to be in subdirectory \fIpk\fP, and the full file name is Xconstructed by appending the desired size and ``.300pk'' to the Xprefix. For example, a Roman font would have prefix ``cmr''; a X10 point version of this file would be found in \fIpk/cmr10.300pk\fP. XThe third field is zero for a normal font, one for a troff ``special'' Xfont. The fourth field indicates the code set used for the font. XThe code set is found in the file name formed by appending ``.code'' Xto this field. The fifth field is the character code used to Xdetermine kerning information. Typically, the code for lowercase X``a'' (ASCII code 97 decimal) is used. If the code is non-numeric, Xit means to use the character and character code from that troff Xfont. This is used for the special fonts which are really Xextensions of the Roman font. The sixth field is the width of the Xspace at 10 points for a constant width font, or zero for a Xproportionally spaced font. The seventh field is the long name of the Xfont. X.PP XA line that begins with ``-'' separates the file into two Xparts. The first part contains the fonts which are preloaded by Xtroff (can be referenced by number as well as name). XThe second part contains the fonts which are loaded on Xa demand basis (must be referenced by name). X.PP XThe coding tables (*.code) are composed of 128 or 256 double quoted strings. XThe position of the string in the table X(starting from 0 and going to 127 or 255) provides information about the Xglyph encoded in the font file with that code. XAnything between the quoted strings is ignored. Inside the quotes, three Xpossible things can appear. ``##'' means there is no glyph for that code. XA single ASCII character means that that ASCII character is encoded at Xthat position in the font file. The UNIX backslash escape mechanism is Xused for the double quote and backslash characters themselves. Two XASCII letters next to each other create a special character with that Xtwo letter name. ``dg'' would be the troff character ``\\(dg'', the Xdagger. More than one of these names may refer Xto the same glyph in the font file. This is done by specifying more Xthan one pair of characters in the quoted string. If a single ASCII Xcharacter may also be used to refer to the glyph, it must appear after Xall of the two character names. X.ne 2.0i X.SH STANDARD \fIfontlist\fP XThis is the standard \fIfontlist\fP file supplied with JetRoff: X X.nf X.ta X.ft CW X#NAME FILE SPEC CODING KERN SPWIDTH LONG NAME X XR cmr 0 roman2 97 0 Times Roman XI cmti 0 roman2i 97 0 Times Italic XB cmbx 0 roman2 97 0 Times Bold XH cmss 0 roman2 97 0 Sans Serif XHB cmssbx 0 roman2 97 0 Sans Serif Bold XHI cmssi 0 roman2i 97 0 Sans Serif Italic XCW cmtt 0 roman0 97 22 Constant Width XS cmsy 1 mathsy R 0 Math Symbols XST cmtrf 1 mathtrf R 0 Troff Math Symbols XSI cmmi 1 mathit I 0 Italic Math Symbols X---------------------- End of preloaded fonts --------------------- XHD cmssdc 0 roman2 97 0 Sans Serif DemiBold X.ft P X.fi X.SH FILES X.IP \fB/usr/lib/font/devjet/fontlist\fP 2i Xthis font configuration file X.IP \fB/usr/lib/font/devjet/*.code\fP 2i XCoding set descriptions X.IP \fB/usr/lib/font/devjet/pk/*\fP 2i XMetafont packed format font raster files X.IP \fB/usr/lib/font/devjet/makeDESC\fP 2i Xprogram to convert above into troff style ASCII font description files X.IP \fB/usr/lib/font/devjet/mkfont\fP 2i Xprogram to compile troff style ASCII font description files into binary Xfont description files X.SH SEE ALSO XmakeDESC(1), mkfont(1), fontcfg(1), font(5) END_OF_FILE if test 4735 -ne `wc -c <'doc/fontlist.5'`; then echo shar: \"'doc/fontlist.5'\" unpacked with wrong size! fi # end of 'doc/fontlist.5' fi if test -f 'doc/jetroff.1' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/jetroff.1'\" else echo shar: Extracting \"'doc/jetroff.1'\" \(4528 characters\) sed "s/^X//" >'doc/jetroff.1' <<'END_OF_FILE' X.TH jetroff 1 "PC Research, Inc." "JetRoff" X.SH NAME Xjetroff \- Troff text formatting for HP LaserJet Series II printers X.SH SYNOPSIS X\fBjetroff [-p -t -e -g -b] X [-o\fIlist\fB -n\fIN\fB -s\fIN\fB -m\fIXX\fB -r\fIRN\fB -i -q -z -a] X [-F\fIfontdir\fB -R\fIrastdir\fB -c\fIN\fB X-d\fIdest\fB -l\fIN\fP[:\fIW\fP] -S] X\fIfiles\fR ... X.SH DESCRIPTION X\fIjetroff\fP formats \fItroff\fP(1) \fIfiles\fP for the HP LaserJet Series II Xprinters. \fIjetroff\fP acts as a unified and simplified interface Xto the various preprocessors (\fItbl\fP(1), X\fIeqn\fP(1), \fIgrap\fP(1), \fIpic\fP(1)), the \fItroff\fP(1) Xtext formatter, the device dependent postprocessor \fIdjet\fP(1), and the Xline printer spooler \fIlp\fP(1). X.PP XIf no \fIfiles\fP are specified on the command line to \fIjetroff\fP, Xthe standard input is read. The file name ``-'' is taken to mean standard Xinput. X.PP XThe following options are available: X.SS Preprocessor Options XBy default, \fIjetroff\fP scans each source document to determine what XPreprocessors are needed. However, you may force the use of a Xpreprocessor by specifying one or more of the following flags: X.IP \fB-p\fP .5i XRun the \fIpic(1)\fP preprocessor on the \fIfiles\fP. X.IP \fB-t\fP .5i XRun the \fItbl(1)\fP preprocessor on the \fIfiles\fP. X.IP \fB-e\fP .5i XRun the \fIeqn(1)\fP preprocessor on the \fIfiles\fP. X.IP \fB-g\fP .5i XRun the \fIgrap(1)\fP preprocessor on the \fIfiles\fP. X.IP \fB-b\fP .5i XInclude the macros needed for bitmap insertion. X.SS Troff Options X.IP \fB-o\fP\fIlist\fP .5i XPrint only pages whose page numbers appear in the comma-separated \fIlist\fP Xof numbers and ranges. A range \fBN-M\fP mean pages \fIN\fP through \fIM\fP. X.IP \fB-n\fP\fIN\fP .5i XNumber the first generated page with \fIN\fP. X.IP \fB-s\fP\fIN\fP .5i XCause the typesetter to stop every \fIN\fP pages. X.IP \fB-m\fP\fIXX\fP .5i XInclude the \fIXX\fP macros found in \fB/usr/lib/tmac/tmac.\fP\fIXX\fP. X.IP \fB-r\fP\fIRN\fP .5i XSet register \fIR\fP (one character) to \fIN\fP. X.IP \fB-i\fP .5i XRead standard input after the input files are exhausted. X.IP \fB-q\fP .5i XInvoke the simultaneous input-output mode of the \fB.rd\fP request. X.IP \fB-z\fP .5i XPrint only messages generated by \fB.tm\fP requests. X.IP \fB-a\fP .5i XDisplay a crude ASCII approximation of the output on the terminal. X.SS Postprocessor Options X.IP \fB-F\fP\fIfontdir\fP .5i XLook for the font description files in the directory \fIfontdir\fP instead Xof \fB/usr/lib/font\fP. The directory name \fB/devjet\fP will be appended Xto \fIfontdir\fP by \fItroff\fP(1). X.IP \fB-R\fP\fIrastdir\fP .5i XLook for the font raster files in the directory \fIrastdir\fP instead Xof \fB/usr/lib/font/devjet/pk\fP. X.IP \fB-c\fP\fIN\fP .5i XPrint \fIN\fP copies of each page (maximum of 99). X.IP \fB-d\fP\fIdest\fP .5i XSend the output to printer \fIdest\fP, instead of the system default. XThe LPDEST environment variable can also be used to change the destination. X.IP \fB-l\fP\fIN[:W]\fP .5i XPrint in landscape orientation, with \fIN\fP logical pages printed Xon each physical page. \fIW\fP specifies the width of the paper X(default 11i). X.IP \fB-S\fP .5i XPrint postprocessor statistics. X.br X.ne 1i X.SH EXAMPLES X.P XA simple memo using the \fIMM\fP macros: X.RS X\f(CW$ jetroff -mm memo.mm\fP X.RE X.P XPrinted in landscape orientation, two pages side by side: X.RS X\f(CW$ jetroff -l2 -rW5i -rO0 -rL8i -mm memo.mm\fP X.RE XNote that the MM macro package registers which control the Xwidth of the text, the page offset, and the page length have Xbeen adjusted. These settings provide quarter-inch left and Xright margins (laserjet enforced), and a half-inch gutter Xbetween the two pages. Other macro packages may use different Xregister names to adjust these parameters. X.P XSix copies of this manual page, in two-up landscape, on legal size Xpaper which can be cut in half and placed in a PC style binder: X.RS X\f(CW$ jetroff -l2:14i -rs1 -manual -c6 jetroff.1\fP X.RE XNote that \f(CW-manual\fP refers to a copy of the \f(CW-man\fP Xmacros which have been modified to use a page length of 8i Xwhenever the \f(CW-rs1\fP register value is specified. A knowledgeable Xsystem administrator can make these modifications for you. 14 inch Xpaper is ideal for slicing into two sheets whose widths are between X6 and 7 inches (the common range of widths for PC style binders). X.SH FILES X.IP \fB/usr/lib/font/devjet/*\fP 2i Xfont description tables X.IP \fB/usr/lib/font/devjet/pk/*\fP 2i Xfont packed raster files X.SH SEE ALSO Xtroff(1), djet(1), jetcheck(1) X.br X\fIDocumenters Workbench 2.0\fP END_OF_FILE if test 4528 -ne `wc -c <'doc/jetroff.1'`; then echo shar: \"'doc/jetroff.1'\" unpacked with wrong size! fi # end of 'doc/jetroff.1' fi if test -f 'font/devjet/fontlist' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font/devjet/fontlist'\" else echo shar: Extracting \"'font/devjet/fontlist'\" \(4870 characters\) sed "s/^X//" >'font/devjet/fontlist' <<'END_OF_FILE' X# fontlist X# info for makeDESC to use when perusing fonts and building X# DESC. Given this file, and a bunch of MetaFont packed format X# font files in directory "pk", makeDESC and mkfont will X# produce the needed *.out and *.SZ for use by troff and djet. X# X# $Id: fontlist,v 1.1 88/08/27 00:00:03 rick Exp $ X# X# $Log: fontlist,v $ X# Revision 1.1 88/08/27 00:00:03 rick X# Initial revision X# X# X X#NAME FILE SPEC CODING KERN SPWIDTH LONG NAME X XR cmr 0 roman2 97 0 Computer Modern Roman XI cmti 0 roman2i 97 0 Computer Modern Italic XB cmbx 0 roman2 97 0 Computer Modern Bold X#H cmss 0 roman2 97 0 Computer Modern Sans Serif X#HB cmssbx 0 roman2 97 0 Computer Modern Sans Serif Bold X#HI cmssi 0 roman2i 97 0 Computer Modern Sans Serif Ital XCW cmtt 0 roman0 97 22 Computer Modern Constant Width XS cmsy 1 mathsy R 0 Computer Modern Math Symbols XST cmtrf 1 mathtrf R 0 Troff Math Symbols XSI cmmi 1 mathit I 0 Computer Modern Math Italic X----------------------------- End of preloaded fonts --------------------------- X#HD cmssdc 0 roman2 97 0 Sans Serif DemiBold X X# X# Here's some Glyphix fonts you might want to get X# My naming convention: X# xx normal X# Xx Bold X# xX Italic (~12 degree Slant) X# XX Bold Italic X# X# Some of these you might want to name like some other typesetter, X# e.g., APS-5 has PA, PB, PI, PX for the four Palatine variations. X# My method wastes less of the name space. X# X# GLYPHIX BASICS I X#he helv 0 ascii7 97 0 Glyphix Helvette X#He helvb 0 ascii7 97 0 Glyphix Helvette Bold X#hE helvi 0 ascii7 97 0 Glyphix Helvette Italic X#HE helvbi 0 ascii7 97 0 Glyphix Helvette Bold Italic X#ch chan 0 ascii7 97 0 Glyphix Chancellor X#Ch chanb 0 ascii7 97 0 Glyphix Chancellor Bold X#cH chani 0 ascii7 97 0 Glyphix Chancellor Italic X#CH chanbi 0 ascii7 97 0 Glyphix Chancellor Bold Italic X#rk rock 0 ascii7 97 0 Glyphix Rockland X#Rk rockb 0 ascii7 97 0 Glyphix Rockland Bold X#rK rocki 0 ascii7 97 0 Glyphix Rockland Italic X#RK rockbi 0 ascii7 97 0 Glyphix Rockland Bold Italic X# X# GLYPHIX SANS SERIF X#av avan 0 ascii7 97 0 Glyphix Avanti X#Av avanb 0 ascii7 97 0 Glyphix Avanti Bold X#aV avani 0 ascii7 97 0 Glyphix Avanti Italic X#AV avanbi 0 ascii7 97 0 Glyphix Avanti Bold Italic X#ol oliv 0 ascii7 97 0 Glyphix Olivia X#Ol olivb 0 ascii7 97 0 Glyphix Olivia Bold X#oL olivi 0 ascii7 97 0 Glyphix Olivia Italic X#OL olivbi 0 ascii7 97 0 Glyphix Olivia Bold Italic X#gi gill 0 ascii7 97 0 Glyphix Gillies X#Gi gillb 0 ascii7 97 0 Glyphix Gillies Italic X#gI gilli 0 ascii7 97 0 Glyphix Gillies Bold X#GI gillbi 0 ascii7 97 0 Glyphix Gillies Bold Italic X#gx galx 0 ascii7 97 0 Glyphix Galaxy X#Gx galxb 0 ascii7 97 0 Glyphix Galaxy Bold X#gX galxi 0 ascii7 97 0 Glyphix Galaxy Italic X#GX galxbi 0 ascii7 97 0 Glyphix Galaxy Bold Italic X# X# GLYPHIX BOOK X#ga gara 0 ascii7 97 0 Glyphix Garamet X#Ga garab 0 ascii7 97 0 Glyphix Garamet Bold X#gA garai 0 ascii7 97 0 Glyphix Garamet Italic X#GA garabi 0 ascii7 97 0 Glyphix Garamet Bold Italic X#ba basq 0 ascii7 97 0 Glyphix Basque X#Ba basqb 0 ascii7 97 0 Glyphix Basque Bold X#bA basqi 0 ascii7 97 0 Glyphix Basque Italic X#BA basqbi 0 ascii7 97 0 Glyphix Basque Bold Italic X#pa pala 0 ascii7 97 0 Glyphix Palatine X#Pa palab 0 ascii7 97 0 Glyphix Palatine Bold X#pA palai 0 ascii7 97 0 Glyphix Palatine Italic X#PA palabi 0 ascii7 97 0 Glyphix Palatine Bold Italic X#ce cent 0 ascii7 97 0 Glyphix Centrum X#Ce centb 0 ascii7 97 0 Glyphix Centrum Bold X#cE centi 0 ascii7 97 0 Glyphix Centrum Italic X#CE centbi 0 ascii7 97 0 Glyphix Centrum Bold Italic X# X# GLYPHIX DECORATIVE X#co coop 0 ascii7 97 0 Glyphix Coop X#Co coopb 0 ascii7 97 0 Glyphix Coop Bold X#cO coopi 0 ascii7 97 0 Glyphix Coop Italic X#CO coopbi 0 ascii7 97 0 Glyphix Coop Bold Italic X#ab abby 0 ascii7 97 0 Glyphix Abbey X#Ab abbyb 0 ascii7 97 0 Glyphix Abbey Bold X#aB abbyi 0 ascii7 97 0 Glyphix Abbey Italic X#ab abbybi 0 ascii7 97 0 Glyphix Abbey Bold Italic X#bg begt 0 ascii7 97 0 Glyphix Beget X#Bg begtb 0 ascii7 97 0 Glyphix Beget Bold X#bG begti 0 ascii7 97 0 Glyphix Beget Italic X#BG begtbi 0 ascii7 97 0 Glyphix Beget Bold Italic X#or orna 0 ascii7 97 0 Glyphix Orna X#Or ornab 0 ascii7 97 0 Glyphix Orna Bold X#oR ornai 0 ascii7 97 0 Glyphix Orna Italic X#OR ornabi 0 ascii7 97 0 Glyphix Orna Bold Italic X# X# GLYPHIX BASICS II X#us amer 0 ascii7 97 0 Glyphix Amertype X#Us amerb 0 ascii7 97 0 Glyphix Amertype Bold X#uS ameri 0 ascii7 97 0 Glyphix Amertype Italic X#US amerbi 0 ascii7 97 0 Glyphix Amertype Bold Italic X#bc city 0 ascii7 97 0 Glyphix Big City X#Bc cityb 0 ascii7 97 0 Glyphix Big City Bold X#bC cityi 0 ascii7 97 0 Glyphix Big City Italic X#BC citybi 0 ascii7 97 0 Glyphix Big City Bold Italic X#op opti 0 ascii7 97 0 Glyphix Optimis X#Op optib 0 ascii7 97 0 Glyphix Optimis Bold X#oP optii 0 ascii7 97 0 Glyphix Optimis Italic X#OP optibi 0 ascii7 97 0 Glyphix Optimis Bold Italic X# X# Miscellaneous X# X#BE be000n 0 ascii7 97 0 Whacky Engraved font from RBBS END_OF_FILE if test 4870 -ne `wc -c <'font/devjet/fontlist'`; then echo shar: \"'font/devjet/fontlist'\" unpacked with wrong size! fi # end of 'font/devjet/fontlist' fi if test -f 'font/mkfont/readdesc.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'font/mkfont/readdesc.c'\" else echo shar: Extracting \"'font/mkfont/readdesc.c'\" \(6678 characters\) sed "s/^X//" >'font/mkfont/readdesc.c' <<'END_OF_FILE' X#ifndef lint Xstatic char rcsid[] = "$Id: readdesc.c,v 1.1 87/10/23 19:08:14 sysad Exp $"; X#endif X X/* X * $Log: readdesc.c,v $ X * Revision 1.1 87/10/23 19:08:14 sysad X * Initial revision X * X * X */ X X/* Read a binary "ditroff" font file and write an ascii equivalent. */ X/* The written file is in a form which may be re-compiled. */ X/* */ X X#include <stdio.h> X#ifdef SYS5 X#include <fcntl.h> X#else X#include <sys/file.h> X#endif X#include "dev.h" X X#ifdef SYS5 X#define rindex strrchr X#endif X X#define SHORT 0xffff X Xchar *Progname; Xstruct dev dev; Xextern char *malloc(),*rdfont(),*rindex(); X X/* debugging is always compiled off; use adb to set or unset it */ Xint debugging = 0; /* prints tables to stdout if set */ X Xmain(argc,argv) Xint argc; Xchar **argv; X{ X int fd,devsize,pointsizes,indexsize,funnysize,i; X short *points,*char_ind; X char *funny_chars,*ptr; X char **font_list,**fl; X char descbuf[256]; X FILE *descfile; X char *descfn; X X Progname = argv[0]; X if(argc > 2) X { X fprintf(stderr,"usage: %s [descfile]\n",Progname); X exit(1); X } X else if(argc == 2) X descfn = argv[1]; X else X descfn = "DESC.out"; X X if((fd = open(descfn,0,0)) < 0) X { X fprintf(stderr,"%s: can't open %s\n",Progname,descfn); X exit(2); X } X /* copy the name, strip the ".out", and replace it with ".new X * to get the name of the new ascii file. X */ X sprintf(descbuf,"%s",descfn); X ptr = rindex(descbuf + 4,'.'); X if(ptr) X *ptr = '\0'; X strcat(descbuf,".new"); X if((descfile = fopen(descbuf,"w")) == (FILE *)0) X { X fprintf(stderr,"%s: can't open new description file %s for writing\n", X Progname,descbuf); X exit(1); X } X X /* Get the dev structure from the description file */ X devsize = read(fd,(char *)&dev,sizeof(dev)); X if(devsize != sizeof(dev)) X { X fprintf(stderr,"%s: should have been %u bytes\n",Progname,sizeof(dev)); X exit(3); X } X X /* Allocate space for the sizes array, then read it in */ X points = (short *)malloc((unsigned)(2 * (dev.nsizes + 1))); X pointsizes = read(fd,(char *)points,2 *(dev.nsizes + 1)); X pointsizes /= 2; X if(--pointsizes != dev.nsizes) X { X fprintf(stderr,"%s: got %d of %d sizes\n",Progname,pointsizes,dev.nsizes); X exit(3); X } X X /* Now the funny char index table */ X char_ind = (short *)malloc((unsigned)(dev.nchtab * 2)); X funny_chars = malloc(dev.lchname); X indexsize = read(fd,(char *)char_ind,dev.nchtab * 2); X indexsize /= 2; X if(indexsize != dev.nchtab) X { X fprintf(stderr,"%s: got %d of %d index entries\n",Progname,indexsize,dev.nchtab); X exit(4); X } X X /* Now the funny char strings themseleves */ X funnysize = read(fd,funny_chars,dev.lchname); X if(funnysize != dev.lchname) X { X fprintf(stderr,"%s: got %d of %d funny chars\n",Progname,funnysize,dev.lchname); X exit(5); X } X X /* allocate array space to hold pointers to the font names, which */ X /* we accumulate as we read the font descriptions in rdfont(). */ X X font_list = (char **)malloc((unsigned)(dev.nfonts * sizeof(char *))); X fl = font_list; X X /* Now read the font descriptions, print the tables and grab the */ X /* names String space for the names is allocated by rdfont(), so */ X /* we don't have to worry about saving them here. */ X X for(i = 0; i < dev.nfonts; ++i) X *fl++= rdfont(fd,indexsize,funny_chars,char_ind); X *fl = (char *)0; X if(debugging) X printf("\n\n\n\nwriting %s\n",descbuf); X X /* Now that we've read everything, we can print the ascii description X * file; first the stuff from dev, then the funny char strings. X */ X pr_dev(descfile,&dev,points,font_list); X pr_funny(descfile,funny_chars,char_ind,indexsize); X X fl = font_list; X if(debugging) X { X /* read the individual files, to see if they match */ X for(i = 0; i < dev.nfonts; ++i) X { X if(fd >= 0) X close(fd); X if(!*fl) X { X fprintf(stderr,"%s: font #%d--no name\n",Progname,i); X ++fl; X continue; X } X sprintf(descbuf,"%s.out",*fl++); X fprintf(stderr,"checking %s\n",descbuf); X fd = open(descbuf,O_RDONLY,0); X if(fd < 0) X fprintf(stderr,"%s: can't open font file %s\n",Progname,*fl); X else X (void)rdfont(fd,indexsize,funny_chars,char_ind); X } X } X exit(0); X} X X/* Print the "dev" structure to DESC.new, describing the general */ X/* characteristics of the font style */ X Xpr_dev(descfile,dev,points,fontnames) XFILE *descfile; Xstruct dev *dev; Xshort *points; Xchar **fontnames; X{ X int npoints,i,j; X X /* The first three are printed for reference only, as comments. X * They won't be used by mkfont. X */ X fprintf(descfile,"#filesize %d\n",(int)(dev->filesize & SHORT)); X fprintf(descfile,"#nchtab %d\n",(int)(dev->nchtab & SHORT)); X fprintf(descfile,"#lchname %d\n",(int)(dev->lchname & SHORT)); X fprintf(descfile,"fonts %d\t",(int)(dev->nfonts & SHORT)); X pr_fonts(descfile,fontnames,(int)(dev->nfonts)); X fprintf(descfile,"\nsizes\t"); X X npoints = (int)(dev->nsizes & SHORT); X for(i=0;i < npoints; ) X { X for(j=0; (j < 15) && (i < npoints); ++j,++i) X fprintf(descfile,"%-4d",(int)(points[i] & SHORT)); X fprintf(descfile,"\n\t\t"); X } X fprintf(descfile," 0\n"); X fprintf(descfile,"res %d\n",(int)(dev->res & SHORT)); X fprintf(descfile,"hor %d\n",(int)(dev->hor & SHORT)); X fprintf(descfile,"vert %d\n",(int)(dev->vert & SHORT)); X fprintf(descfile,"unitwidth %d\n",(int)(dev->unitwidth & SHORT)); X fprintf(descfile,"paperwidth %d\n",(int)(dev->paperwidth & SHORT)); X fprintf(descfile,"paperlength %d\n",(int)(dev->paperlength & SHORT)); X fprintf(descfile,"biggestfont %d\n",(int)(dev->biggestfont & SHORT)); X fprintf(descfile,"sizescale %d\n",(int)(dev->sizescale & SHORT)); X} X X/* Print the character set to DESC.new */ X Xpr_funny(descfile,str,ind,nstr) XFILE *descfile; Xchar *str; Xshort *ind; Xint nstr; X{ X int i,j,ent; X char *s; X X fprintf(descfile,"charset\n"); X if(debugging) X printf("\n\nFunny char table\n\nINDEX\tENT\tSTR\n"); X for(i = 0; i < nstr; ) X { X for(j = 0; (i < nstr) && (j < 15); ++i,++j) X { X ent = (int)(ind[i] & SHORT); X s = str+ent; X if(*s == '\0') X s = "??"; X if(debugging) X printf("%d\t\t%d\t%s\n",i,ent,s); X /* The funny index table is null-terminated */ X if((ent == 0) && (i != 0)) X { X i = nstr; X break; X } X fprintf(descfile,"%4.4s",str+ent); X } X fprintf(descfile,"\n"); X } X} X X/* Print the names of the fonts to DESC.new. */ X Xpr_fonts(descfile,names,nfonts) XFILE *descfile; Xchar **names; Xint nfonts; X{ X int i; X X /* assume they fit on one line */ X if(!names) X return; X for(i = 0; i < nfonts; ++i) X { X if(names[i]) X fprintf(descfile," %s",names[i]); X else X fprintf(descfile," ??"); X } X fprintf(descfile,"\n"); X} END_OF_FILE if test 6678 -ne `wc -c <'font/mkfont/readdesc.c'`; then echo shar: \"'font/mkfont/readdesc.c'\" unpacked with wrong size! fi # end of 'font/mkfont/readdesc.c' fi echo shar: End of archive 4 \(of 7\). cp /dev/null ark4isdone MISSING="" for I in 1 2 3 4 5 6 7 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 7 archives. rm -f ark[1-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0