home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR16 / GS261P.ZIP / GS261P4.FIX < prev   
Text File  |  1993-07-20  |  11KB  |  362 lines

  1.             Ghostscript 2.6.1 Patch #4
  2.  
  3.  
  4. To apply this patch:
  5.  
  6. cd to the directory containing the ghostscript source and do:
  7.     patch -s < ThisFile
  8. Patch will work silently unless an error occurs.
  9. If you want to watch patch do its thing, leave out the "-s" argument to patch.
  10.  
  11. See the readme.fix file for a summary of the fixes.
  12.  
  13. Prereq: 7/18/93
  14.  
  15. *** 1.3    1993/07/21 02:17:53
  16. --- readme.fix    1993/07/20 10:28:00
  17. ***************
  18. *** 7,13 ****
  19.   Fixes for Ghostscript 2.6.1
  20.   ---------------------------
  21.   
  22. ! (last update: 7/18/93)
  23.   
  24.   This file summarizes a number of important quality fixes for Ghostscript
  25.   2.6.1.  The fixes are supplied in the form of replacements for
  26. --- 7,13 ----
  27.   Fixes for Ghostscript 2.6.1
  28.   ---------------------------
  29.   
  30. ! (last update: 7/20/93)
  31.   
  32.   This file summarizes a number of important quality fixes for Ghostscript
  33.   2.6.1.  The fixes are supplied in the form of replacements for
  34. ***************
  35. *** 329,331 ****
  36. --- 329,341 ----
  37.       startup time.
  38.   Files affected:
  39.       gs_fonts.ps, fonts.doc, use.doc
  40. + ---------------- Fixes up to here distributed 7/18/93 ----------------
  41. + 7/20/93
  42. + -------
  43. + Problem:
  44. +     gdevdjet.c was omitted from the previous patch distribution.
  45. + ---------------- ALL fixes up to here distributed 7/20/93 ----------------
  46. *** 1.1    1993/07/21 00:33:27
  47. --- gdevdjet.c    1993/06/29 00:56:32
  48. ***************
  49. *** 28,36 ****
  50.    */
  51.   
  52.   /*
  53. !  * You may select a resolution of 75, 100, 150, or 300 DPI.
  54. !  * Normally you would do this in the makefile or on the gs command line,
  55. !  * not here.
  56.    *
  57.    * If the preprocessor symbol A4 is defined, the default paper size is
  58.    * the European A4 size; otherwise it is the U.S. letter size (8.5"x11").
  59. --- 28,36 ----
  60.    */
  61.   
  62.   /*
  63. !  * You may select a default resolution of 75, 100, 150, 300, or
  64. !  * (LJ4 only) 600 DPI in the makefile, or an actual resolution on
  65. !  * the gs command line.
  66.    *
  67.    * If the preprocessor symbol A4 is defined, the default paper size is
  68.    * the European A4 size; otherwise it is the U.S. letter size (8.5"x11").
  69. ***************
  70. *** 69,85 ****
  71.       showpage
  72.   
  73.    */
  74. - /*#define X_DPI 300*/
  75. - /*#define Y_DPI 300*/
  76.   
  77. ! #define X_DPI_MAX 300
  78. ! #define Y_DPI_MAX 300
  79. ! #ifndef X_DPI
  80. ! #  define X_DPI X_DPI_MAX
  81.   #endif
  82. ! #ifndef Y_DPI
  83. ! #  define Y_DPI Y_DPI_MAX
  84.   #endif
  85.   
  86.   /*
  87. --- 69,87 ----
  88.       showpage
  89.   
  90.    */
  91.   
  92. ! /* Define the default, maximum resolutions. */
  93. ! #ifdef X_DPI
  94. ! #  define X_DPI2 X_DPI
  95. ! #else
  96. ! #  define X_DPI 300
  97. ! #  define X_DPI2 600
  98.   #endif
  99. ! #ifdef Y_DPI
  100. ! #  define Y_DPI2 Y_DPI
  101. ! #else
  102. ! #  define Y_DPI 300
  103. ! #  define Y_DPI2 600
  104.   #endif
  105.   
  106.   /*
  107. ***************
  108. *** 112,132 ****
  109.   #define LASERJET_MARGINS_A4    0.25, 0.20, 0.25, 0.00
  110.   #define LASERJET_MARGINS_LETTER    0.35, 0.20, 0.35, 0.00
  111.   
  112. - #ifndef A4
  113. - #  define DESKJET_MARGINS    DESKJET_MARGINS_LETTER
  114. - #  define LASERJET_MARGINS    LASERJET_MARGINS_LETTER
  115. - #else
  116. - #  define DESKJET_MARGINS    DESKJET_MARGINS_A4
  117. - #  define LASERJET_MARGINS    LASERJET_MARGINS_A4
  118. - #endif
  119.   /* The number of blank lines that make it worthwhile to reposition */
  120.   /* the cursor. */
  121.   #define MIN_SKIP_LINES 7
  122.   
  123.   /* We round up the LINE_SIZE to a multiple of a ulong for faster scanning. */
  124.   #define W sizeof(word)
  125. - #define LINE_SIZE ((X_DPI_MAX * 85 / 10 + W * 8 - 1) / (W * 8) * W)
  126.   
  127.   /* Printer types */
  128.   #define LJ    0
  129. --- 114,125 ----
  130. ***************
  131. *** 135,140 ****
  132. --- 128,134 ----
  133.   #define LJ3    3
  134.   #define DJ    4
  135.   #define DJ500    5
  136. + #define LJ4    6
  137.   
  138.   /*
  139.    * The notion that there is such a thing as a "PCL printer" is a fiction:
  140. ***************
  141. *** 154,175 ****
  142.               /* (includes mode 2) */
  143.   } compression_modes;
  144.   
  145. - /* The printer initialization strings. */
  146. - private const char *init_strings[] = {
  147. -     /* LaserJet PCL 3, no compression */
  148. -         "\033*p0x0Y\033*b0M",
  149. -     /* LaserJet Plus PCL 3, no compression */
  150. -         "\033*p0x0Y\033*b0M",
  151. -     /* LaserJet IIP PCL 4, mode 2 compression */
  152. -         "\033*r0F\033*p0x75Y\033*b2M",
  153. -     /* LaserJet III PCL 5, mode 2&3 compression */
  154. -         "\033*r0F\033*p0x75Y",
  155. -     /* DeskJet almost PCL 4, mode 2 compression */
  156. -         "\033&k1W\033*p0x0Y\033*b2M",
  157. -     /* DeskJet 500 almost PCL 4, mode 2&3 compression */
  158. -         "\033&k1W\033*p0x0Y",
  159. - };
  160.   /* The device descriptors */
  161.   private dev_proc_open_device(hpjet_open);
  162.   private dev_proc_print_page(djet_print_page);
  163. --- 148,153 ----
  164. ***************
  165. *** 178,183 ****
  166. --- 156,162 ----
  167.   private dev_proc_print_page(ljetplus_print_page);
  168.   private dev_proc_print_page(ljet2p_print_page);
  169.   private dev_proc_print_page(ljet3_print_page);
  170. + private dev_proc_print_page(ljet4_print_page);
  171.   
  172.   gx_device_procs prn_hp_procs =
  173.     prn_matrix_procs(hpjet_open, gdev_pcl_get_initial_matrix,
  174. ***************
  175. *** 225,232 ****
  176.       0.20, 0.25, 0.25, 0.25,        /* margins */
  177.       1, ljet3_print_page);
  178.   
  179.   /* Forward references */
  180. ! private int hpjet_print_page(P4(gx_device_printer *, FILE *, int, compression_modes));
  181.   
  182.   /* Open the printer, adjusting the margins if necessary. */
  183.   private int
  184. --- 204,218 ----
  185.       0.20, 0.25, 0.25, 0.25,        /* margins */
  186.       1, ljet3_print_page);
  187.   
  188. + gx_device_printer far_data gs_ljet4_device =
  189. +   prn_device(prn_hp_procs, "ljet4",
  190. +     DEFAULT_WIDTH_10THS, DEFAULT_HEIGHT_10THS,
  191. +     X_DPI2, Y_DPI2,
  192. +     0.25, 0.0, 0.25, 0.25,        /* margins */
  193. +     1, ljet4_print_page);
  194.   /* Forward references */
  195. ! private int hpjet_print_page(P6(gx_device_printer *, FILE *, int, int, compression_modes, const char *));
  196.   
  197.   /* Open the printer, adjusting the margins if necessary. */
  198.   private int
  199. ***************
  200. *** 261,300 ****
  201.   /* The DeskJet can compress (mode 2) */
  202.   private int
  203.   djet_print_page(gx_device_printer *pdev, FILE *prn_stream)
  204. ! {    return hpjet_print_page(pdev, prn_stream, DJ, mode_2);
  205.   }
  206.   /* The DeskJet500 can compress (modes 2&3) */
  207.   private int
  208.   djet500_print_page(gx_device_printer *pdev, FILE *prn_stream)
  209. ! {    return hpjet_print_page(pdev, prn_stream, DJ500, mode_3);
  210.   }
  211.   /* The LaserJet series II can't compress */
  212.   private int
  213.   ljet_print_page(gx_device_printer *pdev, FILE *prn_stream)
  214. ! {    return hpjet_print_page(pdev, prn_stream, LJ, mode_0);
  215.   }
  216.   /* The LaserJet Plus can't compress */
  217.   private int
  218.   ljetplus_print_page(gx_device_printer *pdev, FILE *prn_stream)
  219. ! {    return hpjet_print_page(pdev, prn_stream, LJplus, mode_0);
  220.   }
  221.   /* All LaserJet series IIIs (III,IIId,IIIp,IIIsi) compress (modes 2&3) */
  222.   private int
  223.   ljet3_print_page(gx_device_printer *pdev, FILE *prn_stream)
  224. ! {    return hpjet_print_page(pdev, prn_stream, LJ3, mode_3);
  225.   }
  226. ! /* LaserJet series IIp & IId compress (mode 2) */
  227. ! /* but don't support *p+ or *b vertical spacing. */
  228.   private int
  229. ! ljet2p_print_page(gx_device_printer *pdev, FILE *prn_stream)
  230. ! {    return hpjet_print_page(pdev, prn_stream, LJ2p, mode_2p);
  231.   }
  232.   
  233.   /* Send the page to the printer.  For speed, compress each scan line, */
  234.   /* since computer-to-printer communication time is often a bottleneck. */
  235.   private int
  236.   hpjet_print_page(gx_device_printer *pdev, FILE *prn_stream, int ptype,
  237. !   compression_modes cmodes)
  238.   {    int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
  239.       int line_size_words = (line_size + W - 1) / W;
  240.       uint storage_size_words = line_size_words * 8; /* data, out_row, out_row_alt, prev_row */
  241. --- 247,302 ----
  242.   /* The DeskJet can compress (mode 2) */
  243.   private int
  244.   djet_print_page(gx_device_printer *pdev, FILE *prn_stream)
  245. ! {    return hpjet_print_page(pdev, prn_stream, DJ, 300, mode_2,
  246. !         "\033&k1W\033*p0x0Y\033*b2M");
  247.   }
  248.   /* The DeskJet500 can compress (modes 2&3) */
  249.   private int
  250.   djet500_print_page(gx_device_printer *pdev, FILE *prn_stream)
  251. ! {    return hpjet_print_page(pdev, prn_stream, DJ500, 300, mode_3,
  252. !         "\033&k1W\033*p0x0Y");
  253.   }
  254.   /* The LaserJet series II can't compress */
  255.   private int
  256.   ljet_print_page(gx_device_printer *pdev, FILE *prn_stream)
  257. ! {    return hpjet_print_page(pdev, prn_stream, LJ, 300, mode_0,
  258. !         "\033*p0x0Y\033*b0M");
  259.   }
  260.   /* The LaserJet Plus can't compress */
  261.   private int
  262.   ljetplus_print_page(gx_device_printer *pdev, FILE *prn_stream)
  263. ! {    return hpjet_print_page(pdev, prn_stream, LJplus, 300, mode_0,
  264. !         "\033*p0x0Y\033*b0M");
  265.   }
  266. + /* LaserJet series IIp & IId compress (mode 2) */
  267. + /* but don't support *p+ or *b vertical spacing. */
  268. + private int
  269. + ljet2p_print_page(gx_device_printer *pdev, FILE *prn_stream)
  270. + {    return hpjet_print_page(pdev, prn_stream, LJ2p, 300, mode_2p,
  271. +         "\033*r0F\033*p0x75Y\033*b2M");
  272. + }
  273.   /* All LaserJet series IIIs (III,IIId,IIIp,IIIsi) compress (modes 2&3) */
  274.   private int
  275.   ljet3_print_page(gx_device_printer *pdev, FILE *prn_stream)
  276. ! {    return hpjet_print_page(pdev, prn_stream, LJ3, 300, mode_3,
  277. !         "\033*r0F\033*p0x75Y");
  278.   }
  279. ! /* LaserJet 4 series compresses, and it needs a special sequence to */
  280. ! /* allow it to specify coordinates at 600 dpi. */
  281.   private int
  282. ! ljet4_print_page(gx_device_printer *pdev, FILE *prn_stream)
  283. ! {    int dots_per_inch = (int)pdev->y_pixels_per_inch;
  284. !     char real_init[50];
  285. !     sprintf(real_init, "\033*r0F\033*p0x75Y\033&u%dD", dots_per_inch);
  286. !     return hpjet_print_page(pdev, prn_stream, LJ4, dots_per_inch, mode_3,
  287. !         real_init);
  288.   }
  289.   
  290.   /* Send the page to the printer.  For speed, compress each scan line, */
  291.   /* since computer-to-printer communication time is often a bottleneck. */
  292.   private int
  293.   hpjet_print_page(gx_device_printer *pdev, FILE *prn_stream, int ptype,
  294. !   int dots_per_inch, compression_modes cmodes, const char *init_string)
  295.   {    int line_size = gdev_mem_bytes_per_scan_line((gx_device *)pdev);
  296.       int line_size_words = (line_size + W - 1) / W;
  297.       uint storage_size_words = line_size_words * 8; /* data, out_row, out_row_alt, prev_row */
  298. ***************
  299. *** 311,317 ****
  300.   #define prev_row ((char *)prev_row_words)
  301.       char *out_data;
  302.       int x_dpi = pdev->x_pixels_per_inch;
  303. !     int y_dots_per_pixel = Y_DPI_MAX / pdev->y_pixels_per_inch;
  304.       int out_count;
  305.       int compression = -1;
  306.       static const char *from2to3 = "\033*b3M";
  307. --- 313,319 ----
  308.   #define prev_row ((char *)prev_row_words)
  309.       char *out_data;
  310.       int x_dpi = pdev->x_pixels_per_inch;
  311. !     int y_dots_per_pixel = dots_per_inch / pdev->y_pixels_per_inch;
  312.       int out_count;
  313.       int compression = -1;
  314.       static const char *from2to3 = "\033*b3M";
  315. ***************
  316. *** 339,345 ****
  317.       {    fprintf(prn_stream, "\033&l%dA", paper_size);
  318.       }
  319.       fputs("\033&l0o0e0L", prn_stream);
  320. !     fputs(init_strings[ptype], prn_stream);
  321.   
  322.       /* Send each scan line in turn */
  323.          {    int lnum;
  324. --- 341,347 ----
  325.       {    fprintf(prn_stream, "\033&l%dA", paper_size);
  326.       }
  327.       fputs("\033&l0o0e0L", prn_stream);
  328. !     fputs(init_string, prn_stream);
  329.   
  330.       /* Send each scan line in turn */
  331.          {    int lnum;
  332. ***************
  333. *** 458,468 ****
  334.              }
  335.       }
  336.   
  337. !     /* end raster graphics */
  338. !     fputs("\033*rB", prn_stream);
  339. !     /* eject page */
  340. !     fputs("\033&l0H", prn_stream);
  341.   
  342.       /* free temporary storage */
  343.       gs_free((char *)storage, storage_size_words, W, "hpjet_print_page");
  344. --- 460,467 ----
  345.              }
  346.       }
  347.   
  348. !     /* end raster graphics and eject page */
  349. !     fputs("\033*rB\f", prn_stream);
  350.   
  351.       /* free temporary storage */
  352.       gs_free((char *)storage, storage_size_words, W, "hpjet_print_page");
  353.