home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 1 / 1660 < prev    next >
Internet Message Format  |  1990-12-28  |  24KB

  1. From: clewis@eci386.uucp (Chris Lewis)
  2. Newsgroups: comp.sources.bugs,alt.sources
  3. Subject: Patch 1 for Psroff 2.0
  4. Message-ID: <1990Aug10.203547.29970@eci386.uucp>
  5. Date: 10 Aug 90 20:35:47 GMT
  6.  
  7. Psroff 2.0 hasn't made it thru comp.sources.unix yet, but it is available
  8. via ftp from at least two sites.  This patch resolves all bugs that I
  9. know of.  All of these bugs are build/configure problems.  There are
  10. some enhancements, but most of them are disabled (and incomplete - wait
  11. for me to finally get the bugs out of ditroff drawing emulation)
  12.  
  13. Please note: I will be moving to Ottawa in a few days.  No, I'm not
  14. leaving the company, I'm opening a new office.  Existing e-mail addresses
  15. will continue to work (via the wonders of mail aliasing), but expect a
  16. delay until I get things rolling again.
  17.  
  18.     This is official patch 01 for Psroff 2.0.
  19.     Please apply it by:
  20.     cd <psroff source directory>
  21.     patch -N -p < <this file>
  22.  
  23. If you had managed to succeed to get psroff 2.0 P0 to build, you may
  24. get a small number of rejects which you may want to examine to ensure
  25. that you fixed 'em right.
  26.  
  27. Bugs:
  28.     - "make check" (audit & Makefile):
  29.     - Made misleading remarks about testing trofftype when no
  30.       /usr/lib/font exists, or FONTDIR somewhere else.
  31.     - Final verification message for HEADERSIZE used literal
  32.       "0" instead of empirically derived value.
  33.     - Bug in awk script caused blowouts.
  34.     - "make installwidths" (widths/Makefile):
  35.     - "@$(IGNORESH) ; \" caused problems on some systems with IGNORESH
  36.       disabled.  Semi-colon removed.
  37.     - widths/widthjt/DESC, widths/widthlj/DESC and widths/widthps/HW
  38.       aren't supposed to be part of the release.  Removed them.
  39.     - ltest.m referenced font PA, which was changed to PR for consistency.
  40.     - debug.c refered to pkmsg which isn't defined when LJ undef'd.
  41.       With this fix, you can now build troff2ps with LJ undef'd, but
  42.       several of the utilities having to do with laserjet fonts (eg:
  43.       all of the "pk*" routines under utils) will not build.
  44.       A "make -k" may help when you REALLY want to undef LJ.
  45.     - troff2.c: fix made for compilers that can't handle float expression
  46.       assignments to integer variables in initializers (Ultrix).
  47.  
  48. Enhancements:
  49.     - Ditroff drawing emulation comprises the bulk of the diffs in this
  50.       patch.  It is disabled, and some code is missing.
  51.       This code will remain in, but disabled, until I get it a bit
  52.       more bullet proof, then I'll also supply the backend code.
  53.       (troff2.c, defs.h, t2conf.c, opt.c)
  54.     - Comment regarding new -Y flag added to lib/psrofflib.
  55.     - Improved greyscale settings in lib/confid.ps
  56.  
  57. *** /tmp/PATCHold/./Makefile    Fri Aug 10 15:58:01 1990
  58. --- ./Makefile    Fri Aug 10 15:58:01 1990
  59. ***************
  60. *** 16,22 ****
  61.   #    Note:        This is a System V Makefile, so you may
  62.   #            have some problems making a few of the items.
  63.   #
  64. ! #ident  "@(#)Makefile: 2.1 Copyright 90/07/18 16:47:31 Chris Lewis"
  65.   
  66.   #    Use s5make on Ultrix and Sun!
  67.   
  68. --- 16,22 ----
  69.   #    Note:        This is a System V Makefile, so you may
  70.   #            have some problems making a few of the items.
  71.   #
  72. ! #ident  "@(#)Makefile: 2.2 Copyright 90/08/10 15:22:08 Chris Lewis"
  73.   
  74.   #    Use s5make on Ultrix and Sun!
  75.   
  76. ***************
  77. *** 377,387 ****
  78.       tbl TEST | PATH=.:$(LIBDIR):$$PATH psroff -T$(TTYPE)
  79.   
  80.   check:    audit sedscript makeincl
  81. !     cd lib ; $(MAKE) psrofflib
  82.       ./audit
  83.   
  84.   checkinstall:    audit sedscript makeincl
  85. !     cd lib ; $(MAKE) psrofflib
  86.       ./audit install
  87.   
  88.   #    This is how I build a release - don't even try running this...!
  89. --- 377,387 ----
  90.       tbl TEST | PATH=.:$(LIBDIR):$$PATH psroff -T$(TTYPE)
  91.   
  92.   check:    audit sedscript makeincl
  93. !     cd lib ; $(MAKE)
  94.       ./audit
  95.   
  96.   checkinstall:    audit sedscript makeincl
  97. !     cd lib ; $(MAKE)
  98.       ./audit install
  99.   
  100.   #    This is how I build a release - don't even try running this...!
  101. *** /tmp/PATCHold/./widths/Makefile    Fri Aug 10 15:58:08 1990
  102. --- ./widths/Makefile    Fri Aug 10 15:58:09 1990
  103. ***************
  104. *** 1,4 ****
  105. ! #2.1 90/07/18
  106.   SCRIPTS    = gfnttab
  107.   TD    = testdir
  108.   PSW    = \
  109. --- 1,4 ----
  110. ! #2.4 90/08/08
  111.   SCRIPTS    = gfnttab
  112.   TD    = testdir
  113.   PSW    = \
  114. ***************
  115. *** 5,16 ****
  116.       widthps/DESC \
  117.       widthps/AB widthps/BR widthps/HB widthps/I  widthps/PX \
  118.       widthps/AI widthps/BX widthps/HO widthps/NB widthps/R \
  119. !     widthps/AR widthps/C  widthps/HW widthps/NI widthps/S \
  120.       widthps/AX widthps/CB widthps/HX widthps/NR widthps/S2 \
  121.       widthps/B  widthps/CO widthps/Hb widthps/NX widthps/ZC \
  122.       widthps/BB widthps/CX widthps/Hi widthps/PB widthps/ZD \
  123.       widthps/BI widthps/Hr widthps/PI widthps/BO widthps/H \
  124. !     widthps/Hx widthps/PR widthjt/DESC widthlj/DESC
  125.   
  126.   include ../makeincl
  127.   
  128. --- 5,16 ----
  129.       widthps/DESC \
  130.       widthps/AB widthps/BR widthps/HB widthps/I  widthps/PX \
  131.       widthps/AI widthps/BX widthps/HO widthps/NB widthps/R \
  132. !     widthps/AR widthps/C  widthps/NI widthps/S \
  133.       widthps/AX widthps/CB widthps/HX widthps/NR widthps/S2 \
  134.       widthps/B  widthps/CO widthps/Hb widthps/NX widthps/ZC \
  135.       widthps/BB widthps/CX widthps/Hi widthps/PB widthps/ZD \
  136.       widthps/BI widthps/Hr widthps/PI widthps/BO widthps/H \
  137. !     widthps/Hx widthps/PR
  138.   
  139.   include ../makeincl
  140.   
  141. ***************
  142. *** 18,24 ****
  143.   
  144.   $(PSW):
  145.       @eval `echo $@ | sed -e 's/\(.*\)\/\([^\/]*\)$$/d=\1 f=s.\2/'` ; \
  146. !         cd $$d ; get $(GFLAGS) $$f
  147.   
  148.   widths:    gfnttab dit2catwid
  149.       -rm -f gfnttab.log
  150. --- 18,24 ----
  151.   
  152.   $(PSW):
  153.       @eval `echo $@ | sed -e 's/\(.*\)\/\([^\/]*\)$$/d=\1 f=s.\2/'` ; \
  154. !         cd $$d ; $(GET) $(GFLAGS) $$f
  155.   
  156.   widths:    gfnttab dit2catwid
  157.       -rm -f gfnttab.log
  158. ***************
  159. *** 41,47 ****
  160.   # (eg: my PK 36 is actually closer to 32)
  161.   sepwidths: ../utils/pk2ditwid
  162.       rm -f pk2sep.log pk2sep.err
  163. !     @ $(IGNORESH) if [ -d $(LJF) ] ; \
  164.       then \
  165.           fontlist=`find $(LJF) -type f \
  166.           '(' -name '*.*.pk' -o -name '*.*.sfp' ')' -print | \
  167. --- 41,47 ----
  168.   # (eg: my PK 36 is actually closer to 32)
  169.   sepwidths: ../utils/pk2ditwid
  170.       rm -f pk2sep.log pk2sep.err
  171. !     @$(IGNORESH) if [ -d $(LJF) ] ; \
  172.       then \
  173.           fontlist=`find $(LJF) -type f \
  174.           '(' -name '*.*.pk' -o -name '*.*.sfp' ')' -print | \
  175. ***************
  176. *** 122,128 ****
  177.   # (eg: my PK 36 is actually closer to 32)
  178.   ljwidths: ../utils/pk2ditwid
  179.       rm -f pk2dit.log pk2dit.err
  180. !     @ $(IGNORESH) if [ -d $(LJF) ] ; \
  181.       then \
  182.           fontlist=`find $(LJF) -type f \
  183.           '(' -name '*.*.pk' -o -name '*.*.sfp' ')' -print | \
  184. --- 122,128 ----
  185.   # (eg: my PK 36 is actually closer to 32)
  186.   ljwidths: ../utils/pk2ditwid
  187.       rm -f pk2dit.log pk2dit.err
  188. !     @$(IGNORESH) if [ -d $(LJF) ] ; \
  189.       then \
  190.           fontlist=`find $(LJF) -type f \
  191.           '(' -name '*.*.pk' -o -name '*.*.sfp' ')' -print | \
  192. ***************
  193. *** 179,191 ****
  194.   install:
  195.   
  196.   installwidths:
  197. !     @$(IGNORESH) ; \
  198.       test -w $(FONTDIR) || (echo "Install as root" ; exit 1 ; ) ; \
  199.       for i in width* ; \
  200.       do \
  201.           base=`echo $$i | sed -e 's/.*width//'` ; \
  202.           test -d $(FONTDIR)/$$base || mkdir $(FONTDIR)/$$base ; \
  203. !         test -w $(FONTDIR)/$$base || (echo "Install as root" ; exit 1 ; ) ; \
  204.           files=`echo width$$base/ft*` ; \
  205.           if [ "$$files" = "width$$base"'/ft*' ] ; \
  206.           then \
  207. --- 179,192 ----
  208.   install:
  209.   
  210.   installwidths:
  211. !     @$(IGNORESH) \
  212.       test -w $(FONTDIR) || (echo "Install as root" ; exit 1 ; ) ; \
  213.       for i in width* ; \
  214.       do \
  215.           base=`echo $$i | sed -e 's/.*width//'` ; \
  216.           test -d $(FONTDIR)/$$base || mkdir $(FONTDIR)/$$base ; \
  217. !         test -w $(FONTDIR)/$$base || \
  218. !         (echo "Install as root" ; exit 1 ; ) ; \
  219.           files=`echo width$$base/ft*` ; \
  220.           if [ "$$files" = "width$$base"'/ft*' ] ; \
  221.           then \
  222. ***************
  223. *** 198,204 ****
  224.   
  225.   cmp:
  226.       test -d $(TD) || mkdir $(TD)
  227. !     @$(IGNORESH)for i in width* ; \
  228.       do \
  229.           base=`echo $$i | sed -e 's/.*width//'` ; \
  230.           cd $$i ; \
  231. --- 199,205 ----
  232.   
  233.   cmp:
  234.       test -d $(TD) || mkdir $(TD)
  235. !     @$(IGNORESH) for i in width* ; \
  236.       do \
  237.           base=`echo $$i | sed -e 's/.*width//'` ; \
  238.           cd $$i ; \
  239. *** /tmp/PATCHold/./tests/ltest.m.S    Fri Aug 10 15:58:15 1990
  240. --- ./tests/ltest.m.S    Fri Aug 10 15:58:15 1990
  241. ***************
  242. *** 1,4 ****
  243. ! .\"Document revision 2.1 90/07/18
  244.   .nr Ej 1
  245.   .TL
  246.   troff2ps testing script.
  247. --- 1,4 ----
  248. ! .\"Document revision 2.2 90/08/10
  249.   .nr Ej 1
  250.   .TL
  251.   troff2ps testing script.
  252. ***************
  253. *** 237,243 ****
  254.   .EN
  255.   .DE
  256.   .H 2 "Hanging Caps"
  257. ! .fp 1 PA
  258.   .fp 3 PB
  259.   .ta 1i
  260.   .in +0.6i
  261. --- 237,243 ----
  262.   .EN
  263.   .DE
  264.   .H 2 "Hanging Caps"
  265. ! .fp 1 PR
  266.   .fp 3 PB
  267.   .ta 1i
  268.   .in +0.6i
  269. *** /tmp/PATCHold/./debug.c    Fri Aug 10 15:58:23 1990
  270. --- ./debug.c    Fri Aug 10 15:58:23 1990
  271. ***************
  272. *** 2,8 ****
  273.   
  274.   #ifndef    lint
  275.   static char SCCSid[] =
  276. !     "@(#)debug.c: 2.1 Copyright 90/07/18 16:51:21 Chris Lewis";
  277.   #endif
  278.   
  279.   #ifdef    DEBUG
  280. --- 2,8 ----
  281.   
  282.   #ifndef    lint
  283.   static char SCCSid[] =
  284. !     "@(#)debug.c: 2.2 Copyright 90/08/08 13:14:09 Chris Lewis";
  285.   #endif
  286.   
  287.   #ifdef    DEBUG
  288. ***************
  289. *** 106,114 ****
  290.       extern char *malloc();
  291.       register char *p = malloc((unsigned) n);
  292.       if (!p) {
  293. !     pkmsg("%s: Out of space! (requesting %d bytes, key: %s)\n",
  294.           progname, n, msg);
  295. !     abort();
  296.       }
  297.       clrarray(p, n);
  298.       return(p);
  299. --- 106,114 ----
  300.       extern char *malloc();
  301.       register char *p = malloc((unsigned) n);
  302.       if (!p) {
  303. !     fprintf(stderr, "%s: Out of space! (requesting %d bytes, key: %s)\n",
  304.           progname, n, msg);
  305. !     exit(1);
  306.       }
  307.       clrarray(p, n);
  308.       return(p);
  309. *** /tmp/PATCHold/./defs.h    Fri Aug 10 15:58:27 1990
  310. --- ./defs.h    Fri Aug 10 15:58:27 1990
  311. ***************
  312. *** 1,4 ****
  313. ! /*    Copyright 1988, 1989 16:51:24 Chris Lewis
  314.           All Rights Reserved
  315.   
  316.       Permission to copy and further distribute is freely given provided
  317. --- 1,4 ----
  318. ! /*    Copyright 1988, 1989 15:15:01 Chris Lewis
  319.           All Rights Reserved
  320.   
  321.       Permission to copy and further distribute is freely given provided
  322. ***************
  323. *** 6,18 ****
  324.       sold for profit.
  325.   
  326.       Project:    Generic Troff drivers
  327. !     Module:        defs.h 2.1 90/07/18 16:51:24
  328.       Author:     Chris Lewis
  329.       Specs:        Main header file - contains some customization
  330.    */
  331.   
  332.   /*    Official Release and Patch level:    */
  333. ! #define    T2VERSION    "@(#)PSROFF Copyright 90/07/18 Chris Lewis - R2 P0"
  334.   
  335.   #ifndef    LIBDIR
  336.   /*    Don't touch this */
  337. --- 6,18 ----
  338.       sold for profit.
  339.   
  340.       Project:    Generic Troff drivers
  341. !     Module:        defs.h 2.2 90/08/10 15:15:01
  342.       Author:     Chris Lewis
  343.       Specs:        Main header file - contains some customization
  344.    */
  345.   
  346.   /*    Official Release and Patch level:    */
  347. ! #define    T2VERSION    "@(#)PSROFF Copyright 90/08/10 Chris Lewis - R2 P1"
  348.   
  349.   #ifndef    LIBDIR
  350.   /*    Don't touch this */
  351. ***************
  352. *** 105,111 ****
  353.   
  354.   /*    Basic drivers: */
  355.   #define    PS    /* Postscript */
  356. ! #define    LJ    /* Laserjet */
  357.   #define    DT    /* ditroff */
  358.   
  359.   /*    Laserjet driver config: */
  360. --- 105,111 ----
  361.   
  362.   /*    Basic drivers: */
  363.   #define    PS    /* Postscript */
  364. ! #define    LJ    /* Laserjet - psroff will not build with this undef'd */
  365.   #define    DT    /* ditroff */
  366.   
  367.   /*    Laserjet driver config: */
  368. ***************
  369. *** 266,272 ****
  370.           befontsel,    /* special function F */
  371.           beoverlay,    /* special function O */
  372.           bepassthru,    /* special function P */
  373. !         bexlat;        /* Xlate function */
  374.       struct troff2befont
  375.           *bestdfont,    /* standard font translate table */
  376.           *besymfont;    /* symbol font translate table */
  377. --- 266,273 ----
  378.           befontsel,    /* special function F */
  379.           beoverlay,    /* special function O */
  380.           bepassthru,    /* special function P */
  381. !         bexlat,        /* Xlate function */
  382. !         bedraw;        /* Ditroff draw emulation routine */
  383.       struct troff2befont
  384.           *bestdfont,    /* standard font translate table */
  385.           *besymfont;    /* symbol font translate table */
  386. ***************
  387. *** 336,342 ****
  388.   #endif
  389.   
  390.   extern int lastFont, lastPoints;
  391. ! extern int lastYPos, lastXPos;
  392.   extern char *progname, *printer, *device;
  393.   extern char **prologs;
  394.   
  395. --- 337,343 ----
  396.   #endif
  397.   
  398.   extern int lastFont, lastPoints;
  399. ! extern int lastYPos, lastXPos, specXPos, specYPos;
  400.   extern char *progname, *printer, *device;
  401.   extern char **prologs;
  402.   
  403. *** /tmp/PATCHold/./t2conf.c    Fri Aug 10 15:58:30 1990
  404. --- ./t2conf.c    Fri Aug 10 15:58:30 1990
  405. ***************
  406. *** 15,21 ****
  407.   
  408.   #ifndef    lint
  409.   static char SCCSid[] =
  410. !     "@(#)t2conf.c: 2.1 Copyright 90/07/18 16:51:40 Chris Lewis";
  411.   #endif
  412.   
  413.   #ifdef    PS
  414. --- 15,21 ----
  415.   
  416.   #ifndef    lint
  417.   static char SCCSid[] =
  418. !     "@(#)t2conf.c: 2.2 Copyright 90/08/10 15:27:22 Chris Lewis";
  419.   #endif
  420.   
  421.   #ifdef    PS
  422. ***************
  423. *** 30,35 ****
  424. --- 30,40 ----
  425.   #include "dt.h"
  426.   #endif
  427.   
  428. + #ifndef    INSPECIAL
  429. + #define    dtDraw    NULL
  430. + #define    psDraw    NULL
  431. + #endif
  432.   extern int FontSel();
  433.   
  434.   /*    Common variables */
  435. ***************
  436. *** 37,58 ****
  437.   int    currentPage = 0;
  438.   
  439.   struct backend B[] = {
  440. ! /*   bename,    beprolog,    beepilog,    bechar,    bepage,    befontsel */
  441. ! /*        beoverlay,    bepassthru    bexlat, bestdfont, besymfont */
  442.   
  443.   #ifdef    PS
  444.       { "ps",    psProlog,    psEpilog,    psChar,    psPage,    FontSel,
  445. !         psOverlay,    NULL,        psXlate, psStdFont, psSymFont },
  446.   #endif
  447.   
  448.   #ifdef    DT
  449.       { "dt",    dtProlog,    dtEpilog,    dtChar,    dtPage,    FontSel,
  450. !         NULL,        dtPassthru,    NULL,    dtStdFont, dtSymFont },
  451.   #endif
  452.   
  453.   #ifdef    LJ
  454.       { "lj",    ljProlog,    ljEpilog,    ljChar,    ljPage,    FontSel,
  455. !         NULL,        NULL,        NULL,   ljStdFont, ljSymFont },
  456.   #endif
  457.       { NULL }
  458.   };
  459. --- 42,67 ----
  460.   int    currentPage = 0;
  461.   
  462.   struct backend B[] = {
  463. ! /*   bename,    beprolog,    beepilog,    bechar,    bepage,    befontsel
  464. !         beoverlay,    bepassthru,    bexlat, beDraw,
  465. !         bestdfont,    besymfont */
  466.   
  467.   #ifdef    PS
  468.       { "ps",    psProlog,    psEpilog,    psChar,    psPage,    FontSel,
  469. !         psOverlay,    NULL,        psXlate, psDraw,
  470. !         psStdFont,    psSymFont },
  471.   #endif
  472.   
  473.   #ifdef    DT
  474.       { "dt",    dtProlog,    dtEpilog,    dtChar,    dtPage,    FontSel,
  475. !         NULL,        dtPassthru,    NULL, dtDraw,
  476. !         dtStdFont,    dtSymFont },
  477.   #endif
  478.   
  479.   #ifdef    LJ
  480.       { "lj",    ljProlog,    ljEpilog,    ljChar,    ljPage,    FontSel,
  481. !         NULL,        NULL,        NULL, NULL,
  482. !         ljStdFont,    ljSymFont },
  483.   #endif
  484.       { NULL }
  485.   };
  486. *** /tmp/PATCHold/./troff2.c    Fri Aug 10 15:58:34 1990
  487. --- ./troff2.c    Fri Aug 10 15:58:34 1990
  488. ***************
  489. *** 15,21 ****
  490.   
  491.   #ifndef    lint
  492.   static char SCCSid[] =
  493. !     "@(#)troff2.c: 2.1 Copyright 90/07/18 16:51:45 Chris Lewis";
  494.   #endif
  495.   
  496.   #define    ESC    0x80
  497. --- 15,21 ----
  498.   
  499.   #ifndef    lint
  500.   static char SCCSid[] =
  501. !     "@(#)troff2.c: 2.2 Copyright 90/08/10 15:15:35 Chris Lewis";
  502.   #endif
  503.   
  504.   #define    ESC    0x80
  505. ***************
  506. *** 49,57 ****
  507.   
  508.   #define    CTOINT(val,sig)    ((~c)&sig)
  509.   
  510. ! int pagelength = DEFPL * TROFFRESOLUTION;
  511. ! int pageoffset = DEFOFF * TROFFRESOLUTION;
  512. ! int pageyoffset = DEFYOFF * TROFFRESOLUTION;
  513.   
  514.   char *version, *shortversion;
  515.   
  516. --- 49,57 ----
  517.   
  518.   #define    CTOINT(val,sig)    ((~c)&sig)
  519.   
  520. ! int pagelength;
  521. ! int pageoffset;
  522. ! int pageyoffset;
  523.   
  524.   char *version, *shortversion;
  525.   
  526. ***************
  527. *** 133,138 ****
  528. --- 133,143 ----
  529.   #endif
  530.           sprintf(username, "uid=%d", getuid());
  531.   
  532. +     /* some compilers complain about floating point in initializers... */
  533. +     pagelength = DEFPL * TROFFRESOLUTION;
  534. +     pageoffset = DEFOFF * TROFFRESOLUTION;
  535. +     pageyoffset = DEFYOFF * TROFFRESOLUTION;
  536.       progname = strrchr(argv[0], '/');
  537.       if (progname)
  538.           progname++;
  539. ***************
  540. *** 345,357 ****
  541.   #endif
  542.   
  543.   #ifdef OPT
  544. !             if (optimize)
  545. !                 canoninsert(xpos, ypos, font, points, nc);
  546. !             else
  547.   #endif
  548. -                 if (be->beputchar)
  549. -                 (*be->beputchar)(xpos, ypos, font, points, nc,
  550. -                     (char *) NULL);
  551.   
  552.               break;
  553.           /* Control codes */
  554. --- 350,361 ----
  555.   #endif
  556.   
  557.   #ifdef OPT
  558. !             canoninsert(xpos, ypos, font, points, nc);
  559. ! #else
  560. !             if (be->beputchar)
  561. !                 (*be->beputchar)(xpos, ypos, font, points, nc,
  562. !                 (char *) NULL);
  563.   #endif
  564.   
  565.               break;
  566.           /* Control codes */
  567. ***************
  568. *** 626,631 ****
  569. --- 630,640 ----
  570.       DBP((D_SPEC,"Dospecial: (%d) %s\n", strlen(string), string));
  571.       while (*string)
  572.       switch(*string) {
  573. +         case 'D':
  574. +         if (be->bedraw)
  575. +             (*be->bedraw)(specXPos, specYPos, string+1);
  576. +         *string = '\0';
  577. +         return;
  578.           case 'E':
  579.           fprintf(stderr, "%s\n", string+1);
  580.           *string = '\0';
  581. *** /tmp/PATCHold/./lib/confid.ps    Fri Aug 10 15:58:44 1990
  582. --- ./lib/confid.ps    Fri Aug 10 15:58:45 1990
  583. ***************
  584. *** 9,18 ****
  585.   %    Module:        confid.ps
  586.   %    Author:     Chris Lewis
  587.   %    Specs:        Confidential overlay inclusion.
  588. ! %ident  @(#)confid.ps: 2.1 Copyright 90/07/18 16:52:40 Chris Lewis"
  589.   
  590.   /Confidential {
  591.       gsave
  592.       .99 setgray
  593.       /Courier-Bold findfont 80 scalefont setfont
  594.       0 0 moveto
  595. --- 9,19 ----
  596.   %    Module:        confid.ps
  597.   %    Author:     Chris Lewis
  598.   %    Specs:        Confidential overlay inclusion.
  599. ! %ident  @(#)confid.ps: 2.2 Copyright 90/08/09 17:13:28 Chris Lewis"
  600.   
  601.   /Confidential {
  602.       gsave
  603. +     106 45 { dup mul exch dup mul add 1.0 exch sub } setscreen
  604.       .99 setgray
  605.       /Courier-Bold findfont 80 scalefont setfont
  606.       0 0 moveto
  607. *** /tmp/PATCHold/./lib/psrofflib.S    Fri Aug 10 15:58:55 1990
  608. --- ./lib/psrofflib.S    Fri Aug 10 15:58:55 1990
  609. ***************
  610. *** 1,4 ****
  611. ! #    2.1 90/07/18
  612.   #    This file controls psroff, you can insert additional printer
  613.   #    types here.  These are eval'd *late* in processing, so that
  614.   #    you can insert $copies etc.
  615. --- 1,4 ----
  616. ! #    2.2 90/08/10
  617.   #    This file controls psroff, you can insert additional printer
  618.   #    types here.  These are eval'd *late* in processing, so that
  619.   #    you can insert $copies etc.
  620. ***************
  621. *** 37,42 ****
  622. --- 37,44 ----
  623.   #                (effectively) 7.5i, the adapters plus
  624.   #                the .5i default makes pages centre
  625.   #                by default in 8.5i (matter of taste).
  626. + #        -Y<vertoff>    ditto, but vertical.  Default 0.
  627. + #                Some postscript printers differ in location.
  628.   #
  629.   #    lparg: how to get output to printer.  Note the "-n$copies" and
  630.   #        -d$ptr.  The $ptr is the psroff selected physical printer
  631. *** /tmp/PATCHold/./audit.S    Fri Aug 10 15:59:03 1990
  632. --- ./audit.S    Fri Aug 10 15:59:04 1990
  633. ***************
  634. *** 1,5 ****
  635.   %%STARTSHELL%%
  636. ! #    Psroff checking script 2.1 90/07/18
  637.   chkinst=false
  638.   for i
  639.   do
  640. --- 1,5 ----
  641.   %%STARTSHELL%%
  642. ! #    Psroff checking script 2.2 90/08/07
  643.   chkinst=false
  644.   for i
  645.   do
  646. ***************
  647. *** 205,211 ****
  648.       then
  649.       echo "ERROR: HEADERSIZE should be set to $acthdr, not $hdrsize"
  650.       else
  651. !     echo "INFO: HEADERSIZE appears to be set correctly to 0"
  652.       fi
  653.   fi
  654.   
  655. --- 205,211 ----
  656.       then
  657.       echo "ERROR: HEADERSIZE should be set to $acthdr, not $hdrsize"
  658.       else
  659. !     echo "INFO: HEADERSIZE appears to be set correctly to $hdrsize"
  660.       fi
  661.   fi
  662.   
  663. ***************
  664. *** 355,367 ****
  665.       if (ftdirfound) {
  666.           for (name in fonts) {
  667.           if (name && !catfonts[name])
  668. !             printf("  FONT %s: don't use: %s/%s/ft%s not installed\n",\
  669.               name, fontdir, printertype, name);
  670.           }
  671.       }
  672.       for (name in catfonts) {
  673.           if (name && !fonts[name])
  674. !         printf("  FONT %s: don't use: %s/%s/ft%s exists, but"
  675.               name, fontdir, printertype, name)
  676.           printf(" no %s.fonts\n", printertype)
  677.       }
  678. --- 355,367 ----
  679.       if (ftdirfound) {
  680.           for (name in fonts) {
  681.           if (name && !catfonts[name])
  682. !             printf("  FONT %s: do not use: %s/%s/ft%s not installed\n",\
  683.               name, fontdir, printertype, name);
  684.           }
  685.       }
  686.       for (name in catfonts) {
  687.           if (name && !fonts[name])
  688. !         printf("  FONT %s: do not use: %s/%s/ft%s exists, but"
  689.               name, fontdir, printertype, name)
  690.           printf(" no %s.fonts\n", printertype)
  691.       }
  692. *** /tmp/PATCHold/./opt.c    Fri Aug 10 15:59:09 1990
  693. --- ./opt.c    Fri Aug 10 15:59:09 1990
  694. ***************
  695. *** 13,22 ****
  696.   
  697.   #include "defs.h"
  698.   
  699.   #ifdef    OPT
  700.   #ifndef    lint
  701.   static char SCCSid[] =
  702. !     "@(#)opt.c: 2.1 Copyright 90/07/18 16:53:02 Chris Lewis";
  703.   #endif
  704.   
  705.   struct insbuf {
  706. --- 13,25 ----
  707.   
  708.   #include "defs.h"
  709.   
  710. + int specXPos, specYPos;
  711. + extern struct cattab tabN[], tabS[];
  712.   #ifdef    OPT
  713.   #ifndef    lint
  714.   static char SCCSid[] =
  715. !     "@(#)opt.c: 2.2 Copyright 90/08/10 15:16:19 Chris Lewis";
  716.   #endif
  717.   
  718.   struct insbuf {
  719. ***************
  720. *** 47,52 ****
  721. --- 50,71 ----
  722.       insptr++;
  723.   }
  724.   
  725. + #ifdef    SORT
  726. + int xsortorder;
  727. + xsort(a, b)
  728. + register struct insbuf *a, *b; {
  729. +     int ret;
  730. +     if (a->xpos < b->xpos)
  731. +     ret = -1;
  732. +     else if (a->xpos > b->xpos)
  733. +     ret = 1;
  734. +     else
  735. +     ret = 0;
  736. +     return(xsortorder * ret);
  737. + }
  738. + #endif
  739.   canonflush() {
  740.       register struct insbuf *ip;
  741.       insptr--;
  742. ***************
  743. *** 59,68 ****
  744. --- 78,99 ----
  745.   
  746.       if (insptr->xpos < insbuf[0].xpos) {
  747.       DBP((D_CAT, "canonflush: BACK (%d chars)\n", insptr - insbuf + 1));
  748. + #ifdef    SORT
  749. +     xsortorder = -1;
  750. +     insdump(insbuf, insptr);
  751. +     qsort(insbuf, insptr - insbuf + 1, sizeof(struct insbuf), xsort);
  752. +     insdump(insbuf, insptr);
  753. + #endif
  754.       for(ip = insptr;ip >= insbuf; ip--)
  755.           canonchar(ip->xpos, insypos, ip->font, ip->points, ip->nc);
  756.       } else {
  757.       DBP((D_CAT, "canonflush: FORW (%d chars)\n", insptr - insbuf + 1));
  758. + #ifdef    SORT
  759. +     xsortorder = 1;
  760. + insdump(insbuf, insptr);
  761. +     qsort(insbuf, insptr - insbuf + 1, sizeof(struct insbuf), xsort);
  762. + insdump(insbuf, insptr);
  763. + #endif
  764.       for(ip = insbuf;ip <= insptr; ip++)
  765.           canonchar(ip->xpos, insypos, ip->font, ip->points, ip->nc);
  766.       }
  767. ***************
  768. *** 77,107 ****
  769.       static short lastypos;
  770.       static sstate = 0;
  771.       static char sbuf[512];
  772. ! #ifdef    SPECIAL
  773.       switch(sstate) {
  774.       case 0:
  775.           if (font == 3 && nc == 34) {
  776.           sstate = 1;
  777. !         lastchar.xpos = xpos;
  778.           lastchar.font = font;
  779.           lastchar.points = points;
  780.           lastchar.nc = nc;
  781. !         lastypos = ypos;
  782.           optflush();
  783.           return;
  784.           }
  785.           break;
  786.       case 1:
  787. !         if (font == 3 && nc == 34 &&
  788. !         xpos == lastchar.xpos && ypos == lastypos) {
  789. !         sstate++;
  790. !         sbuf[0] = '\0';
  791. !         return;
  792. !         }
  793.           if (be->beputchar)
  794.           (*be->beputchar)(lastchar.xpos, lastypos, lastchar.font,
  795.               lastchar.points, lastchar.nc, (char *) NULL);
  796. -         sstate = 0;
  797.           break;
  798.       case 2:
  799.           if (nc == 34 && font == 3) {
  800. --- 108,146 ----
  801.       static short lastypos;
  802.       static sstate = 0;
  803.       static char sbuf[512];
  804. !     register char *p;
  805. ! #ifdef    INSPECIAL
  806. !     /* Inline special directives, not supported yet */
  807.       switch(sstate) {
  808.       case 0:
  809.           if (font == 3 && nc == 34) {
  810.           sstate = 1;
  811. !         lastchar.xpos = specXPos = xpos;
  812.           lastchar.font = font;
  813.           lastchar.points = points;
  814.           lastchar.nc = nc;
  815. !         lastypos = specYPos = ypos;
  816.           optflush();
  817.           return;
  818.           }
  819.           break;
  820.       case 1:
  821. !         if (font == 3 && nc == 34) {
  822. !         if (xpos == lastchar.xpos && ypos == lastypos) {
  823. !             sstate++;
  824. !             sbuf[0] = '\0';
  825. !             return;
  826. !         } else {
  827. !             lastchar.xpos = xpos;
  828. !             lastypos = ypos;
  829. !             /* stay in this state */
  830. !         }
  831. !         } else
  832. !         sstate = 0;
  833.           if (be->beputchar)
  834.           (*be->beputchar)(lastchar.xpos, lastypos, lastchar.font,
  835.               lastchar.points, lastchar.nc, (char *) NULL);
  836.           break;
  837.       case 2:
  838.           if (nc == 34 && font == 3) {
  839. ***************
  840. *** 118,130 ****
  841.           return;
  842.           }
  843.           if (font == 3)
  844. !         strcat(sbuf, be->besymfont[nc].t2b_charseq);
  845.           else
  846. !         strcat(sbuf, be->bestdfont[nc].t2b_charseq);
  847.           return;
  848.       }
  849.   #endif
  850.       optinsert(xpos, ypos, font, points, nc);
  851.   }
  852.   
  853. --- 157,185 ----
  854.           return;
  855.           }
  856.           if (font == 3)
  857. !         p = tabS[nc].ch_name;
  858.           else
  859. !         p = tabN[nc].ch_name;
  860. !         if (strlen(p) >= 2) {
  861. !         if (strcmp(p, "hy") == 0 ||
  862. !             strcmp(p, "mi") == 0 ||
  863. !             strcmp(p, "\\-") == 0)
  864. !             p = "-";
  865. !         else if (strcmp(p, "ff") == 0 ||
  866. !              strcmp(p, "fi") == 0 ||
  867. !              strcmp(p, "fl") == 0)
  868. !             ;
  869. !         else if (strcmp(p, "Fi") == 0)
  870. !             p = "ffi";
  871. !         else if (strcmp(p, "Fl") == 0)
  872. !             p = "ffl";
  873. !         else
  874. !             p = " ";
  875. !         }
  876. !         strcat(sbuf, p);
  877.           return;
  878.       }
  879.   #endif
  880.       optinsert(xpos, ypos, font, points, nc);
  881.   }
  882.   
  883. ***************
  884. *** 214,218 ****
  885. --- 269,284 ----
  886.       for (from = bp->t2b_charseq; *from;)
  887.       *optp++ = *from++;
  888.       *optp = '\0';
  889. + }
  890. + #endif
  891. + #ifdef    SORT
  892. + insdump(b, p)
  893. + register struct insbuf *b, *p; {
  894. +     if (!(debug&D_VERB))
  895. +     return;
  896. +     DBP((D_VERB, "insdump:\n"));
  897. +     for(; b <= p; b++)
  898. +     DBP((D_VERB, "%d %d\n", b->xpos, b->nc));
  899.   }
  900.   #endif
  901. -- 
  902. Chris Lewis, Elegant Communications Inc, {uunet!attcan,utzoo}!lsuc!eci386!clewis
  903. Ferret mailing list: eci386!ferret-list, psroff mailing list: eci386!psroff-list
  904. Psroff information/questions: psroff-request@eci386
  905.