home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume20 / dvi / patch01 / patch-1.6-1.7
Encoding:
Text File  |  1991-05-25  |  10.5 KB  |  328 lines

  1. *** tmp/Makefile    Thu May  9 13:25:23 1991
  2. --- Makefile    Mon May 20 19:05:45 1991
  3. ***************
  4. *** 1,5
  5.   # Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  6. ! # $Header: Makefile,v 1.22 91/05/09 14:25:22 hmgr Exp $
  7.   
  8.   CXX = CC
  9.   .SUFFIXES: .C
  10.  
  11. --- 1,5 -----
  12.   # Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  13. ! # $Header: Makefile,v 1.24 91/05/20 20:05:44 hmgr Exp $
  14.   
  15.   CXX = CC
  16.   .SUFFIXES: .C
  17. ***************
  18. *** 7,13
  19.       $(CXX) $(CFLAGS) -c $<
  20.   
  21.   # other system-dependent options - use only one of the -D<sys> macros:
  22. ! #CFLAGS = -O -DBSD -DMSDOS
  23.   CFLAGS = -g
  24.   LIBS = -lm
  25.   
  26.  
  27. --- 7,17 -----
  28.       $(CXX) $(CFLAGS) -c $<
  29.   
  30.   # other system-dependent options - use only one of the -D<sys> macros:
  31. ! # -DBSD            for BSD derivatives
  32. ! # -DMSDOS        for Zortech C++ - also run "make msdos-files"
  33. ! # -DFREE_TAKES_CHAR    if you have a free(char*) instead of free(void*)
  34. ! # -DHP2686_FPATH=/path1:/path2:...
  35. ! #            to modify the default font search path
  36.   CFLAGS = -g
  37.   LIBS = -lm
  38.   
  39. *** tmp/README    Fri Feb 22 15:31:52 1991
  40. --- README    Thu May 23 10:45:10 1991
  41. ***************
  42. *** 1,4
  43. ! $Header: README,v 1.10 91/02/22 16:31:45 hmgr Exp $
  44.   
  45.   Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  46.   You can do what you wish with this as long as
  47.  
  48. --- 1,4 -----
  49. ! $Header: README,v 1.15 91/05/23 11:45:11 hmgr Exp $
  50.   
  51.   Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  52.   You can do what you wish with this as long as
  53. ***************
  54. *** 9,20
  55.   software.  It is completely unsupported.  You're on your own.
  56.   
  57.   
  58. ! This is version 1.4 of my TeX DVI filter.  I'd written it about 4 years
  59. ! ago since, at that time, the only LaserJet DVI filters available to me
  60. ! were in Pascal and ungodly slow.  Anyway, it's been pointed out to me
  61. ! that "dvi" still one of the better DVIs around, so I figured it was time
  62. ! to get off my duff and make it available to the world at large.  Or at
  63. ! small - I'm not picky.
  64.   
  65.   The man-page lists all the pertinent details, but here's some
  66.   highlights:
  67.  
  68. --- 9,20 -----
  69.   software.  It is completely unsupported.  You're on your own.
  70.   
  71.   
  72. ! This is the TeX DVI filter which I'd written it about 4 years ago when,
  73. ! at that time, the only LaserJet DVI filters available to me were in
  74. ! Pascal and ungodly slow.  Anyway, it's been pointed out to me that "dvi"
  75. ! still one of the better DVIs around, so I figured it was time to get off
  76. ! my duff and make it available to the world at large.  Or at small - I'm
  77. ! not picky.
  78.   
  79.   The man-page lists all the pertinent details, but here's some
  80.   highlights:
  81. ***************
  82. *** 47,57
  83.   among other things.)
  84.   
  85.   Dvi currently compiles right up on HP-UX 7.0, 6.5, and 6.2 (s300s or
  86. ! s800s), BSD4.3 (Tahoe) on hp300 hardware, and Zortech C++ on MSDOS.  I
  87. ! use AT&T's C++ 2.0 (cfront) and not G++ on all my Unix boxes.  I do NOT
  88. ! use C++ streams, but do use stdio.  I have NO idea how much work it'll
  89. ! take to get it running on other systems or using G++, but it shouldn't
  90. ! be too hard.
  91.   
  92.   
  93.   Anyway, just type "make" to build a debug version of "dvi".  Then copy
  94.  
  95. --- 47,57 -----
  96.   among other things.)
  97.   
  98.   Dvi currently compiles right up on HP-UX 7.0, 6.5, and 6.2 (s300s or
  99. ! s800s), BSD4.3 (Tahoe) on hp300 hardware, Zortech C++ on MSDOS, and
  100. ! Sparc.  I use AT&T's C++ 2.0 (cfront) and not G++ on all my Unix boxes.
  101. ! I do NOT use C++ streams, but do use stdio.  I have NO idea how much
  102. ! work it'll take to get it running on other systems or using G++, but it
  103. ! shouldn't be too hard.
  104.   
  105.   
  106.   Anyway, just type "make" to build a debug version of "dvi".  Then copy
  107. ***************
  108. *** 57,63
  109.   Anyway, just type "make" to build a debug version of "dvi".  Then copy
  110.   "dvi" and "dvi.1" to whatever names and whatever places you want them.
  111.   You will have to define -DMSDOS or -DBSD in the Makefile if you are on
  112. ! those systems.
  113.   
  114.   Use "make ljdump" to build the "ljdump" program.  This is useful for
  115.   debugging dvi by converting PCL to a semi-human-readable dump.
  116.  
  117. --- 57,63 -----
  118.   Anyway, just type "make" to build a debug version of "dvi".  Then copy
  119.   "dvi" and "dvi.1" to whatever names and whatever places you want them.
  120.   You will have to define -DMSDOS or -DBSD in the Makefile if you are on
  121. ! those systems.  My Sparc also needed -DFREE_TAKES_CHAR.
  122.   
  123.   Use "make ljdump" to build the "ljdump" program.  This is useful for
  124.   debugging dvi by converting PCL to a semi-human-readable dump.
  125. ***************
  126. *** 74,76
  127.   
  128.   
  129.       -- Parag Patel <parag@sde.hp.com>
  130.  
  131. --- 74,89 -----
  132.   
  133.   
  134.       -- Parag Patel <parag@sde.hp.com>
  135. + --------------------REVISION-INFO----------------------
  136. + 1.6    released on HP INTERX Contrib Tape and comp.sources.misc
  137. + 1.7    first bug-fix release
  138. +     files modified: Makefile README extern.h main.C readfont.C hp2686.h
  139. +     ported to Sparc - minor ifdef needed
  140. +     version string slightly modified so say_hello() in main.C works
  141. +     also look for fonts such as /path/cmr7.300pk and cmr7.300gf
  142. +     allow overriding default font search path from Makefile
  143. *** tmp/extern.h    Fri Feb 22 14:59:13 1991
  144. --- extern.h    Fri May 17 15:28:16 1991
  145. ***************
  146. *** 1,5
  147.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  148. ! // $Header: extern.h,v 1.24 91/02/22 15:59:02 hmgr Exp $
  149.   
  150.   // externs for various LaserJet+ DVI filter functions
  151.   //
  152.  
  153. --- 1,5 -----
  154.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  155. ! // $Header: extern.h,v 1.25 91/05/17 16:28:17 hmgr Exp $
  156.   
  157.   // externs for various LaserJet+ DVI filter functions
  158.   //
  159. ***************
  160. *** 91,97
  161.   // convienient inlines - these would otherwise would have to go elsewhere
  162.   
  163.   inline char *strnew(size_t len) { return (char*)malloc(len + 1); }
  164. ! inline void  strfree(char *s) { if (s != NULL) free((void *)s); }
  165.   inline char *strdup(const char *s)
  166.       { return s != NULL ? strcpy((char*)malloc(strlen(s) + 1), s) : NULL; }
  167.   inline boolean streq(const char *s1, const char *s2)
  168.  
  169. --- 91,101 -----
  170.   // convienient inlines - these would otherwise would have to go elsewhere
  171.   
  172.   inline char *strnew(size_t len) { return (char*)malloc(len + 1); }
  173. ! #if FREE_TAKES_CHAR
  174. ! inline void  strfree(const char *s) { if (s != NULL) free((char *)s); }
  175. ! #else
  176. ! inline void  strfree(const char *s) { if (s != NULL) free((const void *)s); }
  177. ! #endif
  178.   inline char *strdup(const char *s)
  179.       { return s != NULL ? strcpy((char*)malloc(strlen(s) + 1), s) : NULL; }
  180.   inline boolean streq(const char *s1, const char *s2)
  181. *** tmp/main.C    Tue Apr  2 16:50:35 1991
  182. --- main.C    Fri May 17 15:28:21 1991
  183. ***************
  184. *** 1,5
  185.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  186. ! static const char rcsid[] = "$Header: main.C,v 1.31 91/04/02 17:50:33 hmgr Exp $";
  187.   
  188.   // TeX DVI filter main() - just parses arguments and calls functions
  189.   //
  190.  
  191. --- 1,5 -----
  192.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  193. ! static const char rcsid[] = "$Header: main.C,v 1.32 91/05/17 16:28:22 hmgr Exp $";
  194.   
  195.   // TeX DVI filter main() - just parses arguments and calls functions
  196.   //
  197. ***************
  198. *** 7,13
  199.   
  200.   #include "defs.h"
  201.   
  202. ! static char *const whatid = "@(#) dvi 1.6 (02 April 1991)";
  203.   
  204.   static void say_hello()
  205.   {
  206.  
  207. --- 7,13 -----
  208.   
  209.   #include "defs.h"
  210.   
  211. ! static char *const whatid = "@(#)dvi 1.7 (02 April 1991)";
  212.   
  213.   static void say_hello()
  214.   {
  215. *** tmp/readfont.C    Tue Apr  2 16:50:29 1991
  216. --- readfont.C    Mon May 20 15:12:45 1991
  217. ***************
  218. *** 1,5
  219.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  220. ! static const char rcsid[] = "$Header: readfont.C,v 1.21 91/04/02 17:50:26 hmgr Exp $";
  221.   
  222.   // read font data from the METAFONT GF (generic font) files
  223.   //
  224.  
  225. --- 1,5 -----
  226.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  227. ! static const char rcsid[] = "$Header: readfont.C,v 1.22 91/05/20 16:12:46 hmgr Exp $";
  228.   
  229.   // read font data from the METAFONT GF (generic font) files
  230.   //
  231. ***************
  232. *** 31,36
  233.       static char buf[MAXPATHLEN + 1];
  234.       sprintf(buf, "%s/%s/%s%s", dir, mag, base, ext);
  235.       char *path = buf;
  236.       FILE *fp = fopen(path, F_READ);
  237.       if (fp == NULL)
  238.       return FALSE;
  239.  
  240. --- 31,38 -----
  241.       static char buf[MAXPATHLEN + 1];
  242.       sprintf(buf, "%s/%s/%s%s", dir, mag, base, ext);
  243.       char *path = buf;
  244. +     debug(3, "looking for font file %s", path);
  245.       FILE *fp = fopen(path, F_READ);
  246.       if (fp == NULL)
  247.       return FALSE;
  248. ***************
  249. *** 109,114
  250.       if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
  251.           return;
  252.       if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
  253.           return;
  254.       }
  255.       quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
  256.  
  257. --- 111,124 -----
  258.       if (tryfile(f, p.path, gfmagdir(p.dirs, f.mag), f.basename, ""))
  259.           return;
  260.       if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ""))
  261. +         return;
  262. +     char ext[30];
  263. +     sprintf(ext, ".%dpk", RESOLUTION);
  264. +     if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
  265. +         return;
  266. +     sprintf(ext, ".%dgf", RESOLUTION);
  267. +     if (tryfile(f, p.path, pkmagdir(p.dirs, f.mag), f.basename, ext))
  268.           return;
  269.       }
  270.       quit("Cannot find font file \"%s\" (at or near magnification %ld.%03ld) anywhere",
  271. *** tmp/hp2686.h    Fri Feb 22 14:58:59 1991
  272. --- hp2686.h    Mon May 20 19:05:50 1991
  273. ***************
  274. *** 1,5
  275.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  276. ! // $Header: hp2686.h,v 1.13 91/02/22 15:58:47 hmgr Exp $
  277.   
  278.   // HP2686 LaserJet+ device-specific definitions.
  279.   // The LaserJet+ Reference Manual should be consulted for more
  280.  
  281. --- 1,5 -----
  282.   // Copyright (c) 1991 by Parag Patel.  All Rights Reserved.
  283. ! // $Header: hp2686.h,v 1.14 91/05/20 20:05:52 hmgr Exp $
  284.   
  285.   // HP2686 LaserJet+ device-specific definitions.
  286.   // The LaserJet+ Reference Manual should be consulted for more
  287. ***************
  288. *** 37,42
  289.       void rule(double v, double h);
  290.   };
  291.   
  292.   #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  293.   
  294.   // about 1 inch from both margins - tweaked until TeX test comes out right
  295.  
  296. --- 37,43 -----
  297.       void rule(double v, double h);
  298.   };
  299.   
  300. + #ifndef HP2686_FPATH
  301.   #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  302.   #endif
  303.   
  304. ***************
  305. *** 38,43
  306.   };
  307.   
  308.   #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  309.   
  310.   // about 1 inch from both margins - tweaked until TeX test comes out right
  311.   // when printed to a LaserJet - lots of fun with unprintable regions!
  312.  
  313. --- 39,45 -----
  314.   
  315.   #ifndef HP2686_FPATH
  316.   #define HP2686_FPATH "/usr/lib/tex/fontbits/laser:/usr/lib/tex/fnt:/usr/local/tex/fontbits/laser"
  317. + #endif
  318.   
  319.   // about 1 inch from both margins - tweaked until TeX test comes out right
  320.   // when printed to a LaserJet - lots of fun with unprintable regions!
  321.