home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume8 / jetroff / patch02 next >
Encoding:
Text File  |  1989-09-09  |  7.0 KB  |  318 lines

  1. Newsgroups: comp.sources.misc
  2. organization: PC Research, Inc.
  3. subject: v08i031: JetRoff DWB troff to HP postprocessor - Patch02
  4. From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5. Reply-To: jetroff@pcrat.UUCP (JetRoff Mail)
  6.  
  7. Posting-number: Volume 8, Issue 31
  8. Submitted-by: jetroff@pcrat.UUCP (JetRoff Mail)
  9. Archive-name: jetroff/patch02
  10.  
  11. JetRoff Usenet version 1.1 Patch 02. 10/04/88.
  12.  
  13. This patch should make it possible to use JetRoff on a LaserJet+.
  14. I totally botched the "SERIES=1" support. I don't have an older HP,
  15. and I screwed up and didn't do a "make install" when I thought I
  16. tested it on the Series II.  I was missing some changes anyway.
  17. This version, at least, works on the Series II, so it has a
  18. chance of turning the trick for the LasetJet+.  Turns out a LOT
  19. of clones emulate the plus, so if you have a clone try building
  20. JetRoff with -DSERIES=1.
  21.  
  22. This patch also fixes some minor makefile glitches.
  23.  
  24. Apply this patch this way:
  25.  
  26.     cd root_of_JetRoff_source
  27.     patch -p <Patch02
  28.  
  29. Here are the diffs:
  30. *** ../1.1.1/makefile    Mon Oct  3 19:07:21 1988
  31. --- makefile    Tue Oct  4 18:01:14 1988
  32. ***************
  33. *** 30,36
  34.       cd font; make $@ UNIX=$(UNIX)
  35.       cd bm; make $@ UNIX=$(UNIX)
  36.   
  37. ! bsd:
  38.       cd bsd; make
  39.   
  40.   install all: message
  41.  
  42. --- 30,36 -----
  43.       cd font; make $@ UNIX=$(UNIX)
  44.       cd bm; make $@ UNIX=$(UNIX)
  45.   
  46. ! bsd:    FRC
  47.       cd bsd; make
  48.   
  49.   install all: message
  50. *** ../1.1.1/djet/out.c    Mon Oct  3 19:07:33 1988
  51. --- djet/out.c    Tue Oct  4 17:57:09 1988
  52. ***************
  53. *** 69,75
  54.   register int there;
  55.   {
  56.       int        therelen;
  57. !     register int    delta = there - here;
  58.       register int    deltalen;
  59.   
  60.   #    if SERIES == 1
  61.  
  62. --- 69,75 -----
  63.   register int there;
  64.   {
  65.       int        therelen;
  66. !     register int    delta;
  67.       register int    deltalen;
  68.   
  69.   #    if SERIES == 1
  70. ***************
  71. *** 76,81
  72.           here *= 12; here /= 5;
  73.           there *= 12; there /= 5;
  74.   #    endif
  75.       if (there >= 1000) therelen = 4;
  76.       else if (there >= 100) therelen = 3;
  77.       else if (there >= 10) therelen = 2;
  78.  
  79. --- 76,82 -----
  80.           here *= 12; here /= 5;
  81.           there *= 12; there /= 5;
  82.   #    endif
  83. +     delta = there - here;
  84.       if (there >= 1000) therelen = 4;
  85.       else if (there >= 100) therelen = 3;
  86.       else if (there >= 10) therelen = 2;
  87. ***************
  88. *** 112,118
  89.       {
  90.           if (y == hpy) return;
  91.   #        if SERIES == 1
  92. !             Printf("\033*p%sV", best_way_there(bufy, hpy, y));
  93.   #        else
  94.               Printf("\033*p%sY", best_way_there(bufy, hpy, y));
  95.   #        endif
  96.  
  97. --- 113,119 -----
  98.       {
  99.           if (y == hpy) return;
  100.   #        if SERIES == 1
  101. !             Printf("\033&a%sV", best_way_there(bufy, hpy, y));
  102.   #        else
  103.               Printf("\033*p%sY", best_way_there(bufy, hpy, y));
  104.   #        endif
  105. ***************
  106. *** 120,126
  107.       else if (y == hpy)
  108.       {
  109.   #        if SERIES == 1
  110. !             Printf("\033*p%sH", best_way_there(bufx, hpx, x));
  111.   #        else
  112.               Printf("\033*p%sX", best_way_there(bufx, hpx, x));
  113.   #        endif
  114.  
  115. --- 121,127 -----
  116.       else if (y == hpy)
  117.       {
  118.   #        if SERIES == 1
  119. !             Printf("\033&a%sH", best_way_there(bufx, hpx, x));
  120.   #        else
  121.               Printf("\033*p%sX", best_way_there(bufx, hpx, x));
  122.   #        endif
  123. ***************
  124. *** 128,134
  125.       else
  126.       {
  127.   #        if SERIES == 1
  128. !             Printf("\033*p%sh%sV",
  129.                   best_way_there(bufx, hpx, x),
  130.                   best_way_there(bufy, hpy, y));
  131.   #        else
  132.  
  133. --- 129,135 -----
  134.       else
  135.       {
  136.   #        if SERIES == 1
  137. !             Printf("\033&a%sh%sV",
  138.                   best_way_there(bufx, hpx, x),
  139.                   best_way_there(bufy, hpy, y));
  140.   #        else
  141. *** ../1.1.1/djet/jetbackup.c    Mon Oct  3 19:07:59 1988
  142. --- djet/jetbackup.c    Tue Oct  4 17:59:53 1988
  143. ***************
  144. *** 503,509
  145.       register int    mdots;
  146.   
  147.   #    if SERIES == 1
  148. !         Printf("\033*p%dV", 4*720);
  149.   #    else
  150.           Printf("\033*p%dY", 4*300);
  151.   #    endif
  152.  
  153. --- 503,509 -----
  154.       register int    mdots;
  155.   
  156.   #    if SERIES == 1
  157. !         Printf("\033&a%dV", 4*720);
  158.   #    else
  159.           Printf("\033*p%dY", 4*300);
  160.   #    endif
  161. ***************
  162. *** 517,523
  163.           else
  164.               x = (PageWidth*3/4) - mdots/2;
  165.           x *= 12; x /= 5;
  166. !         Printf("\033*p%dH", x);
  167.       }
  168.   #    else
  169.           if (page == 4)
  170.  
  171. --- 517,523 -----
  172.           else
  173.               x = (PageWidth*3/4) - mdots/2;
  174.           x *= 12; x /= 5;
  175. !         Printf("\033&a%dH", x);
  176.       }
  177.   #    else
  178.           if (page == 4)
  179. *** ../1.1.1/djet/pk16.c    Tue Oct  4 17:53:11 1988
  180. --- djet/pk16.c    Tue Oct  4 17:59:09 1988
  181. ***************
  182. *** 46,51
  183.   #include "paths.h"
  184.   
  185.   #define PERM    /* Make fonts permanent (for testing) */
  186.   
  187.   typedef struct
  188.   {
  189.  
  190. --- 46,54 -----
  191.   #include "paths.h"
  192.   
  193.   #define PERM    /* Make fonts permanent (for testing) */
  194. + #if SERIES==1
  195. + #define    OLDHPFONT
  196. + #endif
  197.   
  198.   typedef struct
  199.   {
  200. ***************
  201. *** 479,486
  202.   {
  203.       register long height;
  204.   
  205. !     Fprintf(fp, "\033)s%dW", FONT_DESC_SIZE);
  206. !     ljshort(fp, FONT_DESC_SIZE);
  207.       ljbyte(fp, 0);
  208.       ljbyte(fp, FONT_TYPE_8BIT);
  209.       ljshort(fp, 0);
  210.  
  211. --- 482,494 -----
  212.   {
  213.       register long height;
  214.   
  215. ! #    ifdef OLDHPFONT
  216. !         Fprintf(fp, "\033)s%dW", OLD_FONT_DESC_SIZE);
  217. !         ljshort(fp, OLD_FONT_DESC_SIZE);
  218. ! #    else
  219. !         Fprintf(fp, "\033)s%dW", FONT_DESC_SIZE);
  220. !         ljshort(fp, FONT_DESC_SIZE);
  221. ! #    endif
  222.       ljbyte(fp, 0);
  223.       ljbyte(fp, FONT_TYPE_8BIT);
  224.       ljshort(fp, 0);
  225. ***************
  226. *** 507,527
  227.       ljbyte(fp, STYLE_UPRIGHT);
  228.       ljbyte(fp, STROKE_MEDIUM);
  229.       ljbyte(fp, TYPEFACE_TMSRMN);
  230. !     ljbyte(fp, 0);
  231. !     ljbyte(fp, SERIF_SANS_SQUARE);
  232. !     ljshort(fp, 0);
  233. !     ljbyte(fp, 0);
  234. !     ljbyte(fp, 0);
  235. !     ljshort(fp, 0);
  236. !     ljshort(fp, 0);
  237. !     ljshort(fp, 0);
  238. !     ljshort(fp, 0);
  239. !     ljbyte(fp, 0);
  240. !     ljbyte(fp, 0);
  241. !     ljshort(fp, 0);
  242. !     ljshort(fp, 0);
  243. !     ljshort(fp, 0);
  244. !     (void) fwrite(p->name, 16, 1, fp);
  245.       p->loaded = 1;
  246.   #ifdef PERM
  247.       Fprintf(fp, "\033*c%dF", 5);
  248.  
  249. --- 515,537 -----
  250.       ljbyte(fp, STYLE_UPRIGHT);
  251.       ljbyte(fp, STROKE_MEDIUM);
  252.       ljbyte(fp, TYPEFACE_TMSRMN);
  253. ! #    ifndef OLDHPFONT
  254. !         ljbyte(fp, 0);
  255. !         ljbyte(fp, SERIF_SANS_SQUARE);
  256. !         ljshort(fp, 0);
  257. !         ljbyte(fp, 0);
  258. !         ljbyte(fp, 0);
  259. !         ljshort(fp, 0);
  260. !         ljshort(fp, 0);
  261. !         ljshort(fp, 0);
  262. !         ljshort(fp, 0);
  263. !         ljbyte(fp, 0);
  264. !         ljbyte(fp, 0);
  265. !         ljshort(fp, 0);
  266. !         ljshort(fp, 0);
  267. !         ljshort(fp, 0);
  268. !         (void) fwrite(p->name, 16, 1, fp);
  269. ! #    endif
  270.       p->loaded = 1;
  271.   #ifdef PERM
  272.       Fprintf(fp, "\033*c%dF", 5);
  273. *** ../1.1.1/djet/lj.h    Mon Oct  3 19:07:09 1988
  274. --- djet/lj.h    Tue Oct  4 18:00:52 1988
  275. ***************
  276. *** 27,32
  277.   {
  278.       ushort    font_desc_size;
  279.   #                define FONT_DESC_SIZE    64
  280.       uchar    r1;
  281.       uchar    font_type;
  282.   #                define FONT_TYPE_7BIT    0
  283.  
  284. --- 27,33 -----
  285.   {
  286.       ushort    font_desc_size;
  287.   #                define FONT_DESC_SIZE    64
  288. + #                define OLD_FONT_DESC_SIZE    26
  289.       uchar    r1;
  290.       uchar    font_type;
  291.   #                define FONT_TYPE_7BIT    0
  292. *** ../1.1.1/font/mkfont/Makefile    Mon Oct  3 19:06:59 1988
  293. --- font/mkfont/Makefile    Tue Oct  4 18:04:57 1988
  294. ***************
  295. *** 39,44
  296.       lint -phbvac dev.h font.h ${RDSRC} > lint.rdfont
  297.   
  298.   install: all
  299.       cp mkfont $(FONTDIR)
  300.   
  301.   clobber: clean
  302.  
  303. --- 39,45 -----
  304.       lint -phbvac dev.h font.h ${RDSRC} > lint.rdfont
  305.   
  306.   install: all
  307. +     if [ ! -d $(FONTDIR) ]; then mkdir $(FONTDIR); fi
  308.       cp mkfont $(FONTDIR)
  309.   
  310.   clobber: clean
  311. -- 
  312. Rick Richardson | JetRoff "di"-troff to LaserJet Postprocessor|uunet!pcrat!dry2
  313. PC Research,Inc.| Mail: uunet!pcrat!jetroff; For anon uucp do:|for Dhrystone 2
  314. uunet!pcrat!rick| uucp jetroff!~jetuucp/file_list ~nuucp/.    |submission forms.
  315. jetroff Wk2200-0300,Sa,Su ACU {2400,PEP} 12013898963 "" \d\r\d ogin: jetuucp
  316.  
  317.  
  318.