[comp.sources.bugs] Lemming fixes

lee@uhccux.UUCP (10/03/87)

Alan Paeth suggested that some postscript user should fix
up the details in the ps output module of his Lemming editor.
Here's a try at that, in the form of a patch file for lempost.c .

There is also included here a minor adjustment for lemhelp.c,
so that "help all" will display the quit command on the screen.

You may not want to apply the third patch supplied here -- it
enlarges the size of an X window to correspond more closely with
the size of an 8.5x11 page as printed on the Apple LaserWriter.
But after this change, positions of text and lines on the screen
do not correspond with their relative positions when printed.
Evidently some further adjustment should be made.
	Greg Lee
U.S.mail: 562 Moore Hall, Dept. of Linguistics, Univ. of Hawaii, HONO, HI 96822
INTERNET: lee@uhccux.uhcc.hawaii.edu
UUCP:     {ihnp4,dcdwest,ucbvax}!sdcsvax!nosc!uhccux!lee
BITNET:   lee%uhccux.uhcc.hawaii.edu@rutgers.edu

# This is a shell archive.  Remove anything before this line
# then unpack it by saving it in a file and typing "sh file"
# (Files unpacked will be owned by you and have default permissions).
# This archive contains the following files:
#	./dif2-lemhelp.c
#	./dif2-lempost.c
#	./dif2-lemx.c
#
if `test ! -s ./dif2-lemhelp.c`
then
echo "writing ./dif2-lemhelp.c"
sed 's/^X//' > ./dif2-lemhelp.c << '\Rogue\Monster\'
X*** lemhelp.c	Tue Sep 22 17:59:56 1987
X--- /uh3g/ling/lee/lemhelp.c	Fri Oct  2 13:44:59 1987
X***************
X*** 7,13
X  #include "lem.h"
X  #include "lemfont.h"
X  
X! #define HELPCHARS "[IHMABDEFGKLNOPRSTUVWX^?"
X  
X  help()
X      {
X
X--- 7,13 -----
X  #include "lem.h"
X  #include "lemfont.h"
X  
X! #define HELPCHARS "[IHMABDEFGKLNOPQRSTUVWX^?"
X  
X  help()
X      {
X***************
X*** 41,47
X  	case 'K': s = "^K   Copy selections (with offset)"; break;
X  	case 'L': s = "^L   Refresh display"; break;
X  	case 'N': s = "^N   No select (deselect all)"; break;
X! 	case 'O': s = "^O   Output PIC \"filename\""; break;
X  	case 'P': s = "^P   Pop (ungroup -- instantiate) selected groups"; break;
X  	case 'Q': s = "^Q   Quit"; break;
X  	case 'R': s = "^R   Read \"filename\""; break;
X
X--- 41,48 -----
X  	case 'K': s = "^K   Copy selections (with offset)"; break;
X  	case 'L': s = "^L   Refresh display"; break;
X  	case 'N': s = "^N   No select (deselect all)"; break;
X! 	/* changed "PIC" to "PostScript" --gl */
X! 	case 'O': s = "^O   Output PostScript \"filename\""; break;
X  	case 'P': s = "^P   Pop (ungroup -- instantiate) selected groups"; break;
X  	case 'Q': s = "^Q   Quit"; break;
X  	case 'R': s = "^R   Read \"filename\""; break;
\Rogue\Monster\
else
  echo "will not over write ./dif2-lemhelp.c"
fi
if [ `wc -c ./dif2-lemhelp.c | awk '{printf $1}'` -ne 1227 ]
then
echo `wc -c ./dif2-lemhelp.c | awk '{print "Got " $1 ", Expected " 1227}'`
fi
if `test ! -s ./dif2-lempost.c`
then
echo "writing ./dif2-lempost.c"
sed 's/^X//' > ./dif2-lempost.c << '\Rogue\Monster\'
X*** lempost.c	Tue Sep 22 17:54:20 1987
X--- /uh3g/ling/lee/lempost.c	Fri Oct  2 13:43:54 1987
X***************
X*** 132,138
X      {
X      thick(i);
X      emph(i);
X!     fprintf(f, "%d %d %d %d boxer\n", Ox, Oy, ABS(Ow), ABS(Oh));
X      }
X  
X  pelli(i)
X
X--- 132,139 -----
X      {
X      thick(i);
X      emph(i);
X! /*    fprintf(f, "%d %d %d %d boxer\n", Ox, Oy, ABS(Ow), ABS(Oh)); */
X!     fprintf(f, "%d %d %d %d boxer\n", Oxl, Oyl, ABS(Ow), ABS(Oh));
X      }
X  
X  pelli(i)
X***************
X*** 164,171
X  out("/sbold {[4 4] 0 setdash} def");
X  out("/sital {[1 1] 0 setdash} def");
X  out("/snone {[   ] 0 setdash} def");
X! out("/swidt {setlinewidth} def");
X! out("/sfont {exch scalefont setfont} def");
X  out("%");
X  out("% object macros");
X  out("/ltext {moveto 5 0 8#040 4 3 roll widthshow} def");
X
X--- 165,172 -----
X  out("/sbold {[4 4] 0 setdash} def");
X  out("/sital {[1 1] 0 setdash} def");
X  out("/snone {[   ] 0 setdash} def");
X! out("/stwid {setlinewidth} def"); /* stwid was misspelled swidt */
X! out("/sfont {exch findfont exch scalefont setfont} def");
X  out("%");
X  out("% object macros");
X  out("/ltext {moveto 5 0 8#040 4 3 roll widthshow} def");
X***************
X*** 171,181
X  out("/ltext {moveto 5 0 8#040 4 3 roll widthshow} def");
X  out("/ctext {moveto dup stringwidth pop 2 div neg 0 rmoveto show} def");
X  out("/rtext {moveto dup stringwidth pop neg 0 rmoveto show} def");
X! out("/cline {newpath 2 4 roll moveto drawto stroke} def");
X! out("/lline {newpath 2 4 roll moveto drawto stroke} def");
X! out("/rline {newpath 2 4 roll moveto drawto stroke} def");
X! out("/boxer {lline} def");
X! out(" /edict {/edict 8 dict def");
X  out(" edict /mtrx matrix put");
X  out("/ellip { edict begin /endangle exch def /startangle exch def");
X  out("         yrad exch def xrad exch def /y exch def /x exch def");
X
X--- 172,188 -----
X  out("/ltext {moveto 5 0 8#040 4 3 roll widthshow} def");
X  out("/ctext {moveto dup stringwidth pop 2 div neg 0 rmoveto show} def");
X  out("/rtext {moveto dup stringwidth pop neg 0 rmoveto show} def");
X! out("/cline {newpath 2 4 roll moveto lineto stroke} def");
X! out("/lline {newpath 2 4 roll moveto lineto stroke} def");
X! out("/rline {newpath 2 4 roll moveto lineto stroke} def");
X! 
X! out("/boxer {newpath 4 2 roll moveto");
X! out("        exch dup 0 rlineto");
X! out("        exch 0 exch rlineto");
X! out("        neg 0 rlineto");
X! out("        closepath stroke} def");
X! 
X! out(" /edict 8 dict def");
X  out(" edict /mtrx matrix put");
X  out("/ellip { edict begin newpath 360 /endangle exch def 0 /startangle exch def");
X  out("         /yrad exch 2 div def /xrad exch 2 div def /y exch def /x exch def");
X***************
X*** 177,184
X  out("/boxer {lline} def");
X  out(" /edict {/edict 8 dict def");
X  out(" edict /mtrx matrix put");
X! out("/ellip { edict begin /endangle exch def /startangle exch def");
X! out("         yrad exch def xrad exch def /y exch def /x exch def");
X  out("         /savematrix mtrx currentmatrix def x y translate");
X  out("         x y translate xrad yrad scazle 0 0 1 startangle endangle arc");
X  out("         savematrix setmatrix end stroke }");
X
X--- 184,191 -----
X  
X  out(" /edict 8 dict def");
X  out(" edict /mtrx matrix put");
X! out("/ellip { edict begin newpath 360 /endangle exch def 0 /startangle exch def");
X! out("         /yrad exch 2 div def /xrad exch 2 div def /y exch def /x exch def");
X  out("         /savematrix mtrx currentmatrix def x y translate");
X  out("         xrad yrad scale 0 0 1 startangle endangle arc");
X  out("         savematrix setmatrix end stroke } def");
X***************
X*** 180,187
X  out("/ellip { edict begin /endangle exch def /startangle exch def");
X  out("         yrad exch def xrad exch def /y exch def /x exch def");
X  out("         /savematrix mtrx currentmatrix def x y translate");
X! out("         x y translate xrad yrad scazle 0 0 1 startangle endangle arc");
X! out("         savematrix setmatrix end stroke }");
X  out("%");
X  out("% global defaults");
X  out("%");
X
X--- 187,194 -----
X  out("/ellip { edict begin newpath 360 /endangle exch def 0 /startangle exch def");
X  out("         /yrad exch 2 div def /xrad exch 2 div def /y exch def /x exch def");
X  out("         /savematrix mtrx currentmatrix def x y translate");
X! out("         xrad yrad scale 0 0 1 startangle endangle arc");
X! out("         savematrix setmatrix end stroke } def");
X  out("%");
X  out("% global defaults");
X  out("%");
\Rogue\Monster\
else
  echo "will not over write ./dif2-lempost.c"
fi
if [ `wc -c ./dif2-lempost.c | awk '{printf $1}'` -ne 4415 ]
then
echo `wc -c ./dif2-lempost.c | awk '{print "Got " $1 ", Expected " 4415}'`
fi
if `test ! -s ./dif2-lemx.c`
then
echo "writing ./dif2-lemx.c"
sed 's/^X//' > ./dif2-lemx.c << '\Rogue\Monster\'
X*** lemx.c	Tue Sep 22 18:00:32 1987
X--- /uh3g/ling/lee/lemx.c	Fri Oct  2 13:44:37 1987
X***************
X*** 69,75
X      
X  start()
X      {
X!     screenw = 512;
X      screenh = 512;
X      if ((XOpenDisplay("")) == NULL) err("display open failed");
X      if (!XrInit(NULL)) err("Xrlib open failed");
X
X--- 69,75 -----
X      
X  start()
X      {
X! /*    screenw = 512;
X      screenh = 512;
X  */
X      screenw = 594;
X***************
X*** 71,76
X      {
X      screenw = 512;
X      screenh = 512;
X      if ((XOpenDisplay("")) == NULL) err("display open failed");
X      if (!XrInit(NULL)) err("Xrlib open failed");
X      win = XCreateWindow(RootWindow, screenw/2, screenh/2, screenw, screenh,
X
X--- 71,79 -----
X      {
X  /*    screenw = 512;
X      screenh = 512;
X+ */
X+     screenw = 594;
X+     screenh = 792;
X      if ((XOpenDisplay("")) == NULL) err("display open failed");
X      if (!XrInit(NULL)) err("Xrlib open failed");
X  /*    win = XCreateWindow(RootWindow, screenw/2, screenh/2, screenw, screenh, */
X***************
X*** 73,79
X      screenh = 512;
X      if ((XOpenDisplay("")) == NULL) err("display open failed");
X      if (!XrInit(NULL)) err("Xrlib open failed");
X!     win = XCreateWindow(RootWindow, screenw/2, screenh/2, screenw, screenh,
X  				2, WhitePixmap, BlackPixmap);
X      if (win == NULL) err("window open failed");
X      lut = DisplayCells() > 2;
X
X--- 76,83 -----
X      screenh = 792;
X      if ((XOpenDisplay("")) == NULL) err("display open failed");
X      if (!XrInit(NULL)) err("Xrlib open failed");
X! /*    win = XCreateWindow(RootWindow, screenw/2, screenh/2, screenw, screenh, */
X!     win = XCreateWindow(RootWindow, screenw/2, 20, screenw, screenh,
X  				2, WhitePixmap, BlackPixmap);
X      if (win == NULL) err("window open failed");
X      lut = DisplayCells() > 2;
\Rogue\Monster\
else
  echo "will not over write ./dif2-lemx.c"
fi
if [ `wc -c ./dif2-lemx.c | awk '{printf $1}'` -ne 1783 ]
then
echo `wc -c ./dif2-lemx.c | awk '{print "Got " $1 ", Expected " 1783}'`
fi
echo "Finished archive 1 of 1"
# if you want to concatenate archives, remove anything after this line
exit

lwv@n8emr.UUCP (Larry W. Virden) (10/06/87)

I am trying to find the original files for this editor.  Perhaps it is
in the comp.sources.unix archives, but I havent seen an index to that for
quite a while...
-- 
Larry W. Virden	 75046,606 (CIS)
674 Falls Place, Reynoldsburg, OH 43068 (614) 864-8817
cbosgd!n8emr!lwv HAM/SWL BBS (HBBS) 614-457-4227.. 300/1200 bps
We haven't inherited the world from our parents, but borrowed it from our children.