- 8.60 snapshot from svn. Patches dropped:

- big-cmap-post
- split-cidfnmap
- exactly-enable-cidfnmap
- Fontmap.local No longer needed:
- gxcht-64bit-crash
This commit is contained in:
Tim Waugh 2007-07-11 11:43:45 +00:00
parent 20e71695f9
commit 36419052f9
12 changed files with 800 additions and 383 deletions

View File

@ -18,3 +18,4 @@ adobe-cmaps-200406.tar.gz
espgs-8.15.2-source.tar.bz2
espgs-8.15.3-source.tar.bz2
espgs-8.15.4-source.tar.bz2
ghostscript-8.60-r8117.tar.bz2

View File

@ -0,0 +1,729 @@
diff -uraN gs-orig/src/gdevijs.c gs-krgb/src/gdevijs.c
--- gs-orig/src/gdevijs.c 2007-04-24 13:00:22.000000000 +0100
+++ gs-krgb/src/gdevijs.c 2007-04-27 14:44:05.000000000 +0100
@@ -23,15 +23,50 @@
* which is a security risk, since any program can be run.
* You should use -dSAFER which sets .LockSafetyParams to true
* before opening this device.
+ *
+ * 11/26/03 David Suffield (gdevijs-krgb-1.0.patch)
+ * (c) 2003-2004 Copyright Hewlett-Packard Development Company, LP
+ *
+ * 1. Removed hpijs 1.0-1.0.2 workarounds, use hpijs 1.0.3 or higher.
+ * 2. Added krgb support.
+ *
+ * 02/21/05 David Suffield (gdevijs-krgb-1.1.patch)
+ * 1. Fixed segfault issue with 1-bit color space.
+ * 2. Fixed z-order issue with colored text on black rectangle.
+ *
+ * 02/22/06 David Suffield (gdevijs-krgb-1.2.patch)
+ * 1. Fixed krgb buffer overflow issue with out-of-band data in fill_rectangle and copy_mono.
+ * This buffer overflow condition occurred with fullbleed print jobs that had k-band images.
+ * 2. Added Dan Coby (artifex) fix for gsijs_read_string_malloc gs_free *str memory leak.
+ *
+ * 06/02/06 David Suffield (gdevijs-krgb-1.3.patch)
+ * 1. Revisited the krgb buffer overflow issue with out-of-band data in fill_rectangle and
+ * copy_mono. Changed the fill_rectangle and copy_mono to an inner loop buffer check
+ * instead of a outer loop x/y extent check.
+ * 2. As requested by Ralph Giles, added K 1-bit and 8-bit support for krgb, but only 1-bit is
+ * implemented for now.
+ *
+ * KRGB definition:
+ * 1. K=1-bit or 8-bit black plane, RGB=24 bit color raster.
+ * 2. K-plane will only contain objects that are black text and black line drawings.
+ * 3. RGB raster will not contain K-plane objects.
+ * 4. K resolution and RGB resolution will be equal.
+ * 5. K-plane will be byte aligned.
+ * 6. K-plane 1-bit definition; 1=black, 0=nothing (KRGB).
+ * 7. K-plane 8-bit definition; 255=black, 0=nothing (KxRGB).
+ *
*/
#include "unistd_.h" /* for dup() */
#include <stdlib.h>
+#include <fcntl.h>
#include "gdevprn.h"
#include "gp.h"
#include "ijs.h"
#include "ijs_client.h"
+//#define KRGB_DEBUG
+
/* This should go into gdevprn.h, or, better yet, gdevprn should
acquire an API for changing resolution. */
int gdev_prn_maybe_realloc_memory(gx_device_printer *pdev,
@@ -49,6 +84,14 @@
private dev_proc_put_params(gsijs_put_params);
private dev_proc_finish_copydevice(gsijs_finish_copydevice);
+/* Following definitions are for krgb support. */
+private dev_proc_create_buf_device(gsijs_create_buf_device);
+private dev_proc_fill_rectangle(gsijs_fill_rectangle);
+private dev_proc_copy_mono(gsijs_copy_mono);
+private dev_proc_fill_mask(gsijs_fill_mask);
+private dev_proc_fill_path(gsijs_fill_path);
+private dev_proc_stroke_path(gsijs_stroke_path);
+
private const gx_device_procs gsijs_procs = {
gsijs_open,
NULL, /* get_initial_matrix */
@@ -123,6 +166,15 @@
IjsClientCtx *ctx;
int ijs_version;
+
+ /* Additional parameters for krgb support. */
+ int krgb_mode; /* 0=false, 1=true */
+ int k_bits; /* number of bits in k plane, 1 or 8 */
+ int k_path; /* k plane path, 0=false, 1=true */
+ int k_width; /* k plane width in pixels */
+ int k_band_size; /* k plane buffer size in bytes, byte aligned */
+ unsigned char *k_band; /* k plane buffer */
+ gx_device_procs prn_procs; /* banding playback procedures */
};
#define DEFAULT_DPI 74 /* See gsijs_set_resolution() below. */
@@ -150,7 +202,13 @@
FALSE, /* Tumble_set */
NULL, /* IjsClient *ctx */
- 0 /* ijs_version */
+ 0, /* ijs_version */
+ 0, /* krgb_mode */
+ 0, /* k_bits */
+ 0, /* k_path */
+ 0, /* k_width */
+ 0, /* k_band_size */
+ NULL /* k_band buffer */
};
@@ -166,12 +224,299 @@
/**************************************************************************/
-/* ------ Private definitions ------ */
+/* ---------------- Low-level graphic procedures ---------------- */
+
+static unsigned char xmask[] =
+{
+ 0x80, /* x=0 */
+ 0x40, /* 1 */
+ 0x20, /* 2 */
+ 0x10, /* 3 */
+ 0x08, /* 4 */
+ 0x04, /* 5 */
+ 0x02, /* 6 */
+ 0x01 /* 7 */
+};
+
+private int gsijs_fill_rectangle(gx_device * dev, int x, int y, int w, int h,
+ gx_color_index color)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
+
+ if (ijsdev->krgb_mode && ijsdev->k_path && y >= 0 && x >= 0)
+ {
+ int raster = (ijsdev->k_width+7) >> 3;
+ register unsigned char *dest;
+ int dest_start_bit;
+ int band_height = ijsdev->k_band_size/raster;
+ int i,j;
+ unsigned char *beg = ijsdev->k_band;
+ unsigned char *end = ijsdev->k_band+ijsdev->k_band_size;
+ unsigned char *p;
+
+ if (h <= 0 || w <= 0)
+ return 0;
+
+ /* Check for out-of-band graphic. */
+ if (x >= ijsdev->k_width || y >= band_height)
+ return 0; /* out-of-band */
+
+ dest_start_bit = x & 7;
+ dest=ijsdev->k_band+(raster*y)+(x >> 3);
+
+ /* Note x,y orgin 0,0 is stored first byte 0 left to right. */
+
+ if (color==0x0)
+ {
+ /* Color is black, store in k plane band instead of regular band. */
+ for (j=0; j<h; j++)
+ {
+ for (i=0; i<w; i++)
+ {
+ p = &dest[(dest_start_bit+i)>>3];
+ if (p >= beg && p <= end)
+ *p |= xmask[(dest_start_bit+i)&7];
+ }
+ dest+=raster;
+ }
+ return 0;
+ }
+ else
+ {
+ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
+ for (j=0; j<h; j++)
+ {
+ for (i=0; i<w; i++)
+ {
+ p = &dest[(dest_start_bit+i)>>3];
+ if (p >= beg && p <= end)
+ *p &= ~xmask[(dest_start_bit+i)&7];
+ }
+ dest+=raster;
+ }
+ }
+ }
+
+ return (*ijsdev->prn_procs.fill_rectangle)(dev, x, y, w, h, color);
+}
+
+private int gsijs_copy_mono(gx_device * dev, const byte * data,
+ int dx, int draster, gx_bitmap_id id,
+ int x, int y, int w, int height, gx_color_index zero, gx_color_index one)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
+
+ // if (ijsdev->krgb_mode && ijsdev->k_path && one==0x0)
+ if (ijsdev->krgb_mode && ijsdev->k_path)
+ {
+ /* Store in k plane band instead of regular band. */
+ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
+ register unsigned char *dest;
+ register const unsigned char *scan;
+ int dest_start_bit;
+ int scan_start_bit;
+ int band_height = ijsdev->k_band_size/raster;
+ int i,h=height;
+ unsigned char *beg = ijsdev->k_band;
+ unsigned char *end = ijsdev->k_band+ijsdev->k_band_size;
+ unsigned char *p;
+
+ if (h <= 0 || w <= 0)
+ return 0;
+
+ /* Check for out-of-band graphic. */
+ if (x >= ijsdev->k_width || y >= band_height)
+ return 0; /* out-of-band */
+
+ scan=data+(dx >> 3);
+ dest_start_bit = x & 7;
+ scan_start_bit = dx & 7;
+ dest=ijsdev->k_band+(raster*y)+(x >> 3);
+
+ if (one==0x0)
+ {
+ /* Color is black, store in k plane band instead of regular band. */
+ while (h-- > 0)
+ {
+ for (i=0; i<w; i++)
+ {
+ if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
+ {
+ p = &dest[(dest_start_bit+i)>>3];
+ if (p >= beg && p <= end)
+ *p |= xmask[(dest_start_bit+i)&7];
+ }
+ }
+ scan+=draster;
+ dest+=raster;
+ }
+ return 0;
+ }
+ else
+ {
+ /* Color is not black, remove any k plane bits for z-order dependencies, store in regular band. */
+ while (h-- > 0)
+ {
+ for (i=0; i<w; i++)
+ {
+ if (scan[(scan_start_bit+i)>>3] & xmask[(scan_start_bit+i)&7])
+ {
+ p = &dest[(dest_start_bit+i)>>3];
+ if (p >= beg && p <= end)
+ *p &= ~xmask[(dest_start_bit+i)&7];
+ }
+ }
+ scan+=draster;
+ dest+=raster;
+ }
+ }
+ }
+
+ return (*ijsdev->prn_procs.copy_mono)(dev, data, dx, draster, id, x, y, w, height, zero, one);
+}
+
+/* ---------------- High-level graphic procedures ---------------- */
+
+private int gsijs_fill_mask(gx_device * dev,
+ const byte * data, int dx, int raster, gx_bitmap_id id,
+ int x, int y, int w, int h,
+ const gx_drawing_color * pdcolor, int depth,
+ gs_logical_operation_t lop, const gx_clip_path * pcpath)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
+ int code;
+
+ ijsdev->k_path = 1;
+
+ code = (*ijsdev->prn_procs.fill_mask)(dev, data, dx, raster, id, x, y, w, h, pdcolor, depth, lop, pcpath);
-/* Versions 1.0 through 1.0.2 of hpijs report IJS version 0.29, and
- require some workarounds. When more up-to-date hpijs versions
- become ubiquitous, all these workarounds should be removed. */
-#define HPIJS_1_0_VERSION 29
+ ijsdev->k_path = 0;
+
+ return code;
+}
+
+private int gsijs_fill_path(gx_device * dev, const gs_imager_state * pis,
+ gx_path * ppath, const gx_fill_params * params,
+ const gx_drawing_color * pdcolor,
+ const gx_clip_path * pcpath)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
+ int code;
+
+ ijsdev->k_path = 1;
+
+ code = (*ijsdev->prn_procs.fill_path)(dev, pis, ppath, params, pdcolor, pcpath);
+
+ ijsdev->k_path = 0;
+
+ return 0;
+}
+
+private int gsijs_stroke_path(gx_device * dev, const gs_imager_state * pis,
+ gx_path * ppath, const gx_stroke_params * params,
+ const gx_drawing_color * pdcolor,
+ const gx_clip_path * pcpath)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)((gx_device_forward *)dev)->target;
+ int code;
+
+ ijsdev->k_path = 1;
+
+ code = (*ijsdev->prn_procs.stroke_path)(dev, pis, ppath, params, pdcolor, pcpath);
+
+ ijsdev->k_path = 0;
+
+ return code;
+}
+
+/* ---------------- krgb banding playback procedures ---------------- */
+
+private int gsijs_get_bits(gx_device_printer * pdev, int y, byte * str, byte ** actual_data)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
+ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
+ int band_height = cdev->page_info.band_params.BandHeight;
+ int band_number = y/band_height;
+ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
+ int y1=raster*(y-(band_height*band_number));
+
+ if (y1 == 0)
+ {
+ /* First raster for band, clear k_band. Banding playback occurs on first raster. */
+ memset(ijsdev->k_band, 0, ijsdev->k_band_size);
+ }
+
+ return gdev_prn_get_bits(pdev, y, str, actual_data); /* get raster from regular band */
+}
+
+private int gsijs_k_get_bits(gx_device_printer * pdev, int y, byte ** actual_data)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)pdev;
+ gx_device_clist_common *cdev = (gx_device_clist_common *)pdev;
+ int band_height = cdev->page_info.band_params.BandHeight;
+ int band_number = y/band_height;
+ int raster = (ijsdev->k_width+7) >> 3; /* raster width in bytes, byte aligned */
+ int y1=raster*(y-(band_height*band_number));
+
+ *actual_data = ijsdev->k_band+y1;
+
+ return 0;
+}
+
+private int gsijs_create_buf_device(gx_device **pbdev, gx_device *target,
+ const gx_render_plane_t *render_plane, gs_memory_t *mem, gx_band_complexity_t *band_complexity)
+{
+ gx_device_ijs *ijsdev = (gx_device_ijs *)target;
+ int n_chan = ijsdev->color_info.num_components;
+ int code = gx_default_create_buf_device(pbdev, target, render_plane, mem, band_complexity);
+ if (code < 0 || n_chan != 3)
+ return code;
+
+ /* Save buffer (vector) procedures so that we can hook them during banding playback. */
+ ijsdev->prn_procs = (*pbdev)->procs;
+
+ /* Replace buffer procedures with krgb procedures. */
+ set_dev_proc(*pbdev, fill_rectangle, gsijs_fill_rectangle);
+ set_dev_proc(*pbdev, copy_mono, gsijs_copy_mono);
+ set_dev_proc(*pbdev, fill_mask, gsijs_fill_mask);
+ set_dev_proc(*pbdev, fill_path, gsijs_fill_path);
+ set_dev_proc(*pbdev, stroke_path, gsijs_stroke_path);
+
+ return code;
+}
+
+/* See if IJS server supports krgb. */
+private int
+gsijs_set_krgb_mode(gx_device_ijs *ijsdev)
+{
+ char buf[256];
+ int n_chan = ijsdev->color_info.num_components;
+ int code;
+
+ ijsdev->krgb_mode = 0; /* default is no krgb */
+
+ if (n_chan != 3)
+ return 0; /* no krgb support, not RGB colorspace */
+
+ buf[0] = 0;
+ code = ijs_client_enum_param(ijsdev->ctx, 0, "ColorSpace", buf, sizeof(buf)-1);
+ if (code >= 0)
+ buf[code] = 0;
+ if (strstr(buf, "KRGB") != NULL)
+ {
+ ijsdev->krgb_mode = 1; /* yes KRGB is supported */
+ ijsdev->k_bits = 1; /* KRGB = 1x8x8x8 */
+ }
+ else if (strstr(buf, "KxRGB") != NULL)
+ {
+ ijsdev->krgb_mode = 1; /* yes KRGB is supported */
+ ijsdev->k_bits = 8; /* KRGB = 8x8x8x8 */
+ }
+
+ return 0;
+}
+
+/* ------ Private definitions ------ */
private int
gsijs_parse_wxh (const char *val, int size, double *pw, double *ph)
@@ -209,34 +554,6 @@
}
/**
- * gsijs_set_generic_params_hpijs: Set generic IJS parameters.
- *
- * This version is specialized for hpijs 1.0 through 1.0.2, and
- * accommodates a number of quirks.
- **/
-private int
-gsijs_set_generic_params_hpijs(gx_device_ijs *ijsdev)
-{
- char buf[256];
- int code = 0;
-
- /* IjsParams, Duplex, and Tumble get set at this point because
- they may affect margins. */
- if (ijsdev->IjsParams) {
- code = gsijs_client_set_param(ijsdev, "IjsParams", ijsdev->IjsParams);
- }
-
- if (code == 0 && ijsdev->Duplex_set) {
- int duplex_val;
-
- duplex_val = ijsdev->Duplex ? (ijsdev->IjsTumble ? 1 : 2) : 0;
- sprintf (buf, "%d", duplex_val);
- code = gsijs_client_set_param(ijsdev, "Duplex", buf);
- }
- return code;
-}
-
-/**
* gsijs_set_generic_params: Set generic IJS parameters.
**/
private int
@@ -247,9 +564,6 @@
int i, j;
char *value;
- if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
- return gsijs_set_generic_params_hpijs(ijsdev);
-
/* Split IjsParams into separate parameters and send to ijs server */
value = NULL;
for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
@@ -290,68 +604,6 @@
}
/**
- * gsijs_set_margin_params_hpijs: Do margin negotiation with IJS server.
- *
- * This version is specialized for hpijs 1.0 through 1.0.2, and
- * accommodates a number of quirks.
- **/
-private int
-gsijs_set_margin_params_hpijs(gx_device_ijs *ijsdev)
-{
- char buf[256];
- int code = 0;
-
- if (code == 0) {
- sprintf(buf, "%d", ijsdev->width);
- code = gsijs_client_set_param(ijsdev, "Width", buf);
- }
- if (code == 0) {
- sprintf(buf, "%d", ijsdev->height);
- code = gsijs_client_set_param(ijsdev, "Height", buf);
- }
-
- if (code == 0) {
- double printable_width, printable_height;
- double printable_left, printable_top;
- float m[4];
-
- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableArea",
- buf, sizeof(buf));
- if (code == IJS_EUNKPARAM)
- /* IJS server doesn't support margin negotiations.
- That's ok. */
- return 0;
- else if (code >= 0) {
- code = gsijs_parse_wxh(buf, code,
- &printable_width, &printable_height);
- }
-
- if (code == 0) {
- code = ijs_client_get_param(ijsdev->ctx, 0, "PrintableTopLeft",
- buf, sizeof(buf));
- if (code == IJS_EUNKPARAM)
- return 0;
- else if (code >= 0) {
- code = gsijs_parse_wxh(buf, code,
- &printable_left, &printable_top);
- }
- }
-
- if (code == 0) {
- m[0] = printable_left;
- m[1] = ijsdev->MediaSize[1] * (1.0 / 72) -
- printable_top - printable_height;
- m[2] = ijsdev->MediaSize[0] * (1.0 / 72) -
- printable_left - printable_width;
- m[3] = printable_top;
- gx_device_set_margins((gx_device *)ijsdev, m, true);
- }
- }
-
- return code;
-}
-
-/**
* gsijs_set_margin_params: Do margin negotiation with IJS server.
**/
private int
@@ -362,9 +614,6 @@
int i, j;
char *value;
- if (ijsdev->ijs_version == HPIJS_1_0_VERSION)
- return gsijs_set_margin_params_hpijs(ijsdev);
-
/* Split IjsParams into separate parameters and send to ijs server */
value = NULL;
for (i=0, j=0; (j < ijsdev->IjsParams_size) && (i < sizeof(buf)-1); j++) {
@@ -531,12 +780,18 @@
char buf[256];
bool use_outputfd;
int fd = -1;
+ long max_bitmap = ijsdev->space_params.MaxBitmap;
if (strlen(ijsdev->IjsServer) == 0) {
eprintf("ijs server not specified\n");
return gs_note_error(gs_error_ioerror);
}
+ ijsdev->space_params.MaxBitmap = 0; /* force banding */
+
+ /* Set create_buf_device in printer device, so that we can hook the banding playback procedures. */
+ ijsdev->printer_procs.buf_procs.create_buf_device = gsijs_create_buf_device;
+
/* Decide whether to use OutputFile or OutputFD. Note: how to
determine this is a tricky question, so we just allow the
user to set it.
@@ -551,6 +806,8 @@
if (code < 0)
return code;
+ ijsdev->space_params.MaxBitmap = max_bitmap;
+
if (use_outputfd) {
/* Note: dup() may not be portable to all interesting IJS
platforms. In that case, this branch should be #ifdef'ed out.
@@ -610,6 +867,9 @@
if (code >= 0)
code = gsijs_set_margin_params(ijsdev);
+ if (code >= 0)
+ code = gsijs_set_krgb_mode(ijsdev);
+
return code;
}
@@ -690,21 +950,6 @@
return min(width, end);
}
-private int ijs_all_white(unsigned char *data, int size)
-{
- int clean = 1;
- int i;
- for (i = 0; i < size; i++)
- {
- if (data[i] != 0xFF)
- {
- clean = 0;
- break;
- }
- }
- return clean;
-}
-
/* Print a page. Don't use normal printer gdev_prn_output_page
* because it opens the output file.
*/
@@ -715,8 +960,10 @@
gx_device_printer *pdev = (gx_device_printer *)dev;
int raster = gdev_prn_raster(pdev);
int ijs_width, ijs_height;
- int row_bytes;
+ int row_bytes, k_row_bytes=0;
int n_chan = pdev->color_info.num_components;
+ int krgb_mode = ijsdev->krgb_mode;
+ int k_bits = ijsdev->k_bits;
unsigned char *data;
char buf[256];
double xres = pdev->HWResolution[0];
@@ -732,13 +979,23 @@
/* Determine bitmap width and height */
ijs_height = gdev_prn_print_scan_lines(dev);
- if (ijsdev->ijs_version == HPIJS_1_0_VERSION) {
- ijs_width = pdev->width;
- } else {
ijs_width = gsijs_raster_width(dev);
- }
+
row_bytes = (ijs_width * pdev->color_info.depth + 7) >> 3;
+ if (krgb_mode)
+ {
+ gx_device_clist_common *cdev = (gx_device_clist_common *)dev;
+ int band_height = cdev->page_info.band_params.BandHeight;
+ k_row_bytes = (ijs_width + 7) >> 3;
+
+ /* Create banding buffer for k plane. */
+ ijsdev->k_width = ijs_width;
+ ijsdev->k_band_size = band_height * k_row_bytes;
+ if ((ijsdev->k_band = gs_malloc(pdev->memory, ijsdev->k_band_size, 1, "gsijs_output_page")) == (unsigned char *)NULL)
+ return gs_note_error(gs_error_VMerror);
+ }
+
/* Required page parameters */
sprintf(buf, "%d", n_chan);
gsijs_client_set_param(ijsdev, "NumChan", buf);
@@ -747,44 +1004,71 @@
/* This needs to become more sophisticated for DeviceN. */
strcpy(buf, (n_chan == 4) ? "DeviceCMYK" :
- ((n_chan == 3) ? "DeviceRGB" : "DeviceGray"));
+ ((n_chan == 3) ? (krgb_mode ? ((k_bits == 1) ? "KRGB" : "KxRGB") : "DeviceRGB") : "DeviceGray"));
gsijs_client_set_param(ijsdev, "ColorSpace", buf);
- /* If hpijs 1.0, don't set width and height here, because it
- expects them to be the paper size. */
- if (ijsdev->ijs_version != HPIJS_1_0_VERSION) {
- sprintf(buf, "%d", ijs_width);
- gsijs_client_set_param(ijsdev, "Width", buf);
- sprintf(buf, "%d", ijs_height);
- gsijs_client_set_param(ijsdev, "Height", buf);
- }
+ sprintf(buf, "%d", ijs_width);
+ gsijs_client_set_param(ijsdev, "Width", buf);
+ sprintf(buf, "%d", ijs_height);
+ gsijs_client_set_param(ijsdev, "Height", buf);
sprintf(buf, "%gx%g", xres, yres);
gsijs_client_set_param(ijsdev, "Dpi", buf);
+#ifdef KRGB_DEBUG
+ int kfd, rgbfd;
+ char sz[128];
+ kfd = open("/tmp/k.pbm", O_CREAT | O_TRUNC | O_RDWR, 0644);
+ rgbfd = open("/tmp/rgb.ppm", O_CREAT | O_TRUNC | O_RDWR, 0644);
+ snprintf(sz, sizeof(sz), "P4\n#gdevijs test\n%d\n%d\n", ijs_width, ijs_height);
+ write(kfd, sz, strlen(sz));
+ snprintf(sz, sizeof(sz), "P6\n#gdevijs test\n%d\n%d\n255\n", ijs_width, ijs_height);
+ write(rgbfd, sz, strlen(sz));
+#endif
+
for (i=0; i<num_copies; i++) {
unsigned char *actual_data;
ijs_client_begin_cmd (ijsdev->ctx, IJS_CMD_BEGIN_PAGE);
status = ijs_client_send_cmd_wait(ijsdev->ctx);
for (y = 0; y < ijs_height; y++) {
- code = gdev_prn_get_bits(pdev, y, data, &actual_data);
- if (code < 0)
- break;
+ if (krgb_mode)
+ code = gsijs_get_bits(pdev, y, data, &actual_data);
+ else
+ code = gdev_prn_get_bits(pdev, y, data, &actual_data);
+ if (code < 0)
+ break;
+#ifdef KRGB_DEBUG
+ write(rgbfd, actual_data, row_bytes);
+#endif
+ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, row_bytes);
+ if (status)
+ break;
- if (ijsdev->ijs_version == HPIJS_1_0_VERSION &&
- ijs_all_white(actual_data, row_bytes))
- status = ijs_client_send_data_wait(ijsdev->ctx, 0, NULL, 0);
- else
- status = ijs_client_send_data_wait(ijsdev->ctx, 0,
- (char *)actual_data, row_bytes);
- if (status)
- break;
+ if (krgb_mode) {
+ code = gsijs_k_get_bits(pdev, y, &actual_data);
+ if (code < 0)
+ break;
+#ifdef KRGB_DEBUG
+ write(kfd, actual_data, k_row_bytes);
+#endif
+ status = ijs_client_send_data_wait(ijsdev->ctx, 0, (char *)actual_data, k_row_bytes);
+ if (status)
+ break;
+ }
}
ijs_client_begin_cmd(ijsdev->ctx, IJS_CMD_END_PAGE);
status = ijs_client_send_cmd_wait(ijsdev->ctx);
}
+#ifdef KRGB_DEBUG
+ close(kfd);
+ close(rgbfd);
+#endif
+
+ if(krgb_mode)
+ gs_free(pdev->memory, ijsdev->k_band, ijsdev->k_band_size, 1, "gsijs_output_page");
+
gs_free_object(pdev->memory, data, "gsijs_output_page");
endcode = (pdev->buffer_space && !pdev->is_async_renderer ?
@@ -1090,7 +1374,6 @@
dprintf2("ijs: Can't set parameter %s=%s\n", key, value);
return code;
}
-
private int
gsijs_set_color_format(gx_device_ijs *ijsdev)

View File

@ -1,8 +0,0 @@
--- espgs-8.15.4/lib/Fontmap.Fontmap.local 2007-04-17 11:02:58.000000000 +0100
+++ espgs-8.15.4/lib/Fontmap 2007-04-17 11:03:16.000000000 +0100
@@ -2,3 +2,5 @@
% See Fontmap.GS for the syntax of real Fontmap files.
%% Replace 1 (Fontmap.GS)
(Fontmap.GS) .runlibfile
+% must be at the bottom of line to allow people overriding everything.
+(Fontmap.local) .runlibfileifexists

View File

@ -1,204 +0,0 @@
--- espgs-8.15.3/lib/gs_ttf.ps.big-cmap-post 2006-06-06 10:59:04.000000000 +0100
+++ espgs-8.15.3/lib/gs_ttf.ps 2006-11-16 17:25:12.000000000 +0000
@@ -261,6 +261,54 @@
} for pop exch pop
} bind def
+/.biglength { % <str>|<array of str> .biglength <integer>
+ dup type /arraytype eq { 0 exch { length add } forall } { length } ifelse
+} bind def
+
+/concats { % [str ...] concats str
+ () exch dup length 1 sub -1 0 {
+ 1 index exch get dup type /stringtype ne { dup length string cvs } if
+ 3 -1 roll exch dup length 2 index length add string
+ dup dup 4 2 roll copy length 4 -1 roll putinterval exch
+ } for pop
+} bind def
+
+% <str>|<array of str> <index> <count> .biggetinterval <str>|<array of str>
+/.biggetinterval {
+ 3 dict begin
+ 2 index type /arraytype eq {
+ /c exch def
+ /i exch def
+ [ exch {
+ dup length /l exch def
+ i c add l gt {
+ i l lt {
+ i l i sub getinterval
+ /c i c add l sub def
+ /i 0 def
+ } {
+ pop
+ /i i l sub def
+ } ifelse
+ } {
+ i c getinterval exit
+ } ifelse
+ } forall
+ ] dup .biglength 65535 le { concats } if
+ } { getinterval } ifelse
+ end
+} bind def
+
+% <str>|<array of str> <index> getu16 <integer>
+/.biggetu16 {
+ 2 .biggetinterval 0 getu16
+} bind def
+
+% <str>|<array of str> <index> getu32 <integer>
+/.biggetu32 {
+ 4 .biggetinterval 0 getu32
+} bind def
+
% Each procedure in this dictionary is called as follows:
% <encodingtable> proc <glypharray>
/cmapformats mark
@@ -351,14 +399,14 @@
} bind
4 { % Microsoft/Adobe segmented mapping.
/etab exch def
- /nseg2 etab 6 getu16 def
- 14 /endc etab 2 index nseg2 getinterval def
+ /nseg2 etab 6 .biggetu16 def
+ 14 /endc etab 2 index nseg2 .biggetinterval def
% The Apple TrueType documentation omits the 2-byte
% 'reserved pad' that follows the endCount vector!
2 add
- nseg2 add /startc etab 2 index nseg2 getinterval def
- nseg2 add /iddelta etab 2 index nseg2 getinterval def
- nseg2 add /idroff etab 2 index nseg2 getinterval def
+ nseg2 add /startc etab 2 index nseg2 .biggetinterval def
+ nseg2 add /iddelta etab 2 index nseg2 .biggetinterval def
+ nseg2 add /idroff etab 2 index nseg2 .biggetinterval def
% The following hack allows us to properly handle
% idiosyncratic fonts that start at 0xf000:
pop
@@ -370,8 +418,8 @@
/numcodes 0 def /glyphs 0 0 2 nseg2 3 sub {
% Stack: /glyphs numglyphs i2
/i2 exch def
- /scode startc i2 getu16 def
- /ecode endc i2 getu16 def
+ /scode startc i2 .biggetu16 def
+ /ecode endc i2 .biggetu16 def
numcodes scode firstcode sub
% Hack for fonts that have only 0x0000 and 0xf000 ranges
%dup 16#e000 ge { 255 and } if
@@ -392,8 +440,8 @@
/numcodes 0 def /code 0 def
0 2 nseg2 3 sub {
/i2 exch def
- /scode startc i2 getu16 def
- /ecode endc i2 getu16 def
+ /scode startc i2 .biggetu16 def
+ /ecode endc i2 .biggetu16 def
numcodes scode firstcode sub
% Hack for fonts that have only 0x0000 and 0xf000 ranges
%dup 16#e000 ge { 255 and } if
@@ -405,15 +453,15 @@
(scode=) print scode =only
( ecode=) print ecode =only
( delta=) print delta =only
- ( droff=) print idroff i2 getu16 =
+ ( droff=) print idroff i2 .biggetu16 =
} if
- idroff i2 getu16 dup 0 eq {
+ idroff i2 .biggetu16 dup 0 eq {
pop scode delta add 65535 and 1 ecode delta add 65535 and
{ putglyph } for
} { % The +2 is for the 'reserved pad'.
/gloff exch 14 nseg2 3 mul add 2 add i2 add add def
0 1 ecode scode sub {
- 2 mul gloff add etab exch getu16
+ 2 mul gloff add etab exch .biggetu16
dup 0 ne { delta add 65535 and } if putglyph
} for
} ifelse
@@ -436,12 +484,12 @@
% <cmaptab> cmaparray <glypharray>
/cmaparray {
- dup 0 getu16 cmapformats exch .knownget {
+ dup 0 .biggetu16 cmapformats exch .knownget {
TTFDEBUG {
- (cmap: format ) print 1 index 0 getu16 = flush
+ (cmap: format ) print 1 index 0 .biggetu16 = flush
} if exec
} {
- (Can't handle format ) print 0 getu16 = flush
+ (Can't handle format ) print 0 .biggetu16 = flush
0 1 255 { } for 256 packedarray
} ifelse
TTFDEBUG {
@@ -513,13 +561,13 @@
% Adobe requirement that each sfnts entry have even length.
/readtables mark
% Ordinary tables
- (cmap) { .readtable }
+ (cmap) { .readbigtable }
(head) 1 index
(hhea) 1 index
(maxp) 1 index
(name) 1 index
(OS/2) 1 index
- (post) 1 index
+ (post) { .readbigtable }
(vhea) 1 index
% Big tables
(glyf) { .readbigtable }
@@ -860,10 +908,17 @@
} ifelse
% Stack: ... /FontInfo mark key1 value1 ...
post null ne {
- /ItalicAngle post 4 gets32 65536.0 div
- /isFixedPitch post 12 getu32 0 ne
- /UnderlinePosition post 8 gets16 upem div
- /UnderlineThickness post 10 gets16 upem div
+ post type /arraytype eq {
+ % this post table is a big table. /post should be [(...) ...]
+ % data we actually need here should be first one in array.
+ /posttable post 1 get def
+ } {
+ /posttable post def
+ } ifelse
+ /ItalicAngle posttable 4 gets32 65536.0 div
+ /isFixedPitch posttable 12 getu32 0 ne
+ /UnderlinePosition posttable 8 gets16 upem div
+ /UnderlineThickness posttable 10 gets16 upem div
} if
counttomark 0 ne { .dicttomark } { pop pop } ifelse
/XUID [orgXUID 42 curxuid]
@@ -922,22 +977,22 @@
} if
tabdict /cmap get % bool [] i PlatID SpecID (cmap)
dup /cmaptab exch def % temporary
- 0 1 2 index 2 getu16 1 sub { % bool [] i PlatID SpecID (cmap) j
- 8 mul 4 add 1 index exch 8 getinterval % bool [] i PlatID SpecID (cmap) (cmapsub)
+ 0 1 2 index 2 .biggetu16 1 sub { % bool [] i PlatID SpecID (cmap) j
+ 8 mul 4 add 1 index exch 8 .biggetinterval % bool [] i PlatID SpecID (cmap) (cmapsub)
TTFDEBUG {
- (cmap: platform ) print dup 0 getu16 =only
- ( encoding ) print dup 2 getu16 = flush
+ (cmap: platform ) print dup 0 .biggetu16 =only
+ ( encoding ) print dup 2 .biggetu16 = flush
} if
- dup 0 getu16 4 index eq {
- dup 2 getu16 3 index eq { % bool [] i PlatID SpecID (cmap) (cmapsub)
+ dup 0 .biggetu16 4 index eq {
+ dup 2 .biggetu16 3 index eq { % bool [] i PlatID SpecID (cmap) (cmapsub)
TTFDEBUG {
(Choosen a cmap for platform=) print 3 index =only
( encoding=) print 2 index =
} if
/cmapsub 1 index def
- dup 4 getu32 % bool [] i PlatID SpecID (cmap) (cmapsub) p
- cmaptab length 1 index sub % bool [] i PlatID SpecID (cmap) (cmapsub) p l
- cmaptab 3 1 roll getinterval
+ dup 4 .biggetu32 % bool [] i PlatID SpecID (cmap) (cmapsub) p
+ cmaptab .biglength 1 index sub % bool [] i PlatID SpecID (cmap) (cmapsub) p l
+ cmaptab 3 1 roll .biggetinterval
/cmaptab exch def % bool [] i PlatID SpecID (cmap) (cmapsub)
5 index 5 index 1 add get % bool [] i PlatID SpecID (cmap) (cmapsub) /Decoding
/Decoding exch def % bool [] i PlatID SpecID (cmap) (cmapsub)

View File

@ -1,8 +0,0 @@
--- espgs-8.15.4/lib/dvipdf.dvipdf 2006-11-30 15:41:51.000000000 +0000
+++ espgs-8.15.4/lib/dvipdf 2007-03-14 21:51:59.000000000 +0000
@@ -39,4 +39,4 @@
# We have to include the options twice because -I only takes effect if it
# appears before other options.
-exec dvips $DVIPSOPTIONS -q -f "$infile" | gs $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
+exec dvips $DVIPSOPTIONS -R -q -f "$infile" | gs $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -

View File

@ -1,66 +0,0 @@
--- espgs-8.15.4/lib/cjkv/tt11util.ps.exactly-enable-cidfnmap 2006-06-06 10:59:04.000000000 +0100
+++ espgs-8.15.4/lib/cjkv/tt11util.ps 2007-04-17 11:09:56.000000000 +0100
@@ -179,6 +179,7 @@
%dup /gsubhog exch _cjkv_type11_tmp /gsubost get _cjkv_type11_tmp /gsubocv get add 4 add _cjkv_type11_tmp /gsubglc get getinterval _cjkv_type11_tmp 3 1 roll put
dup /gsubvog exch _cjkv_type11_tmp /gsubost get 6 add _cjkv_type11_tmp /gsubglc get 2 mul getinterval _cjkv_type11_tmp 3 1 roll put
dup /cvfmt exch _cjkv_type11_tmp /gsubost get _cjkv_type11_tmp /gsubocv get add 0 add .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
+ _cjkv_type11_tmp /cvfmt get 1 eq {
dup /cvglc exch _cjkv_type11_tmp /gsubost get _cjkv_type11_tmp /gsubocv get add 2 add .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
dup /gsubhog exch _cjkv_type11_tmp /gsubost get _cjkv_type11_tmp /gsubocv get add 4 add _cjkv_type11_tmp /cvglc get 2 mul getinterval _cjkv_type11_tmp 3 1 roll put
CJKV_DEBUG_GSUB {
@@ -194,25 +195,26 @@
_cjkv_type11_tmp /gsubvog get exch .cjkv_getu16 =
} for
} if
- _cjkv_type11_tmp /cvfmt get 1 eq {
/gsubh2v << 0 2 _cjkv_type11_tmp /gsubhog get length 2 sub {
dup _cjkv_type11_tmp /gsubhog get exch .cjkv_getu16
exch _cjkv_type11_tmp /gsubvog get exch .cjkv_getu16
} for >> _cjkv_type11_tmp 3 1 roll put
} {
_cjkv_type11_tmp /cvfmt get 2 eq {
- /gsubh2v << 0 6 _cjkv_type11_tmp /gsubhog get length 6 sub {
- dup 0 add /fgid exch _cjkv_type11_tmp /gsubhog get exch .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
- dup 2 add /lgid exch _cjkv_type11_tmp /gsubhog get exch .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
- 4 add /cvidx exch _cjkv_type11_tmp /gsubhog get exch .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
+ dup /cvrngc exch _cjkv_type11_tmp /gsubost get _cjkv_type11_tmp /gsubocv get add 2 add .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
+ dup /cvrngs exch _cjkv_type11_tmp /gsubost get _cjkv_type11_tmp /gsubocv get add 4 add _cjkv_type11_tmp /cvrngc get 6 mul getinterval _cjkv_type11_tmp 3 1 roll put
+ /gsubh2v << 0 6 _cjkv_type11_tmp /cvrngs get length 6 sub {
+ dup 0 add /fgid exch _cjkv_type11_tmp /cvrngs get exch .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
+ dup 2 add /lgid exch _cjkv_type11_tmp /cvrngs get exch .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
+ 4 add /cvidx exch _cjkv_type11_tmp /cvrngs get exch .cjkv_getu16 _cjkv_type11_tmp 3 1 roll put
CJKV_DEBUG_GSUB {
(fgid: ) print _cjkv_type11_tmp /fgid get =
(lgid: ) print _cjkv_type11_tmp /lgid get =
(cvidx: ) print _cjkv_type11_tmp /cvidx get =
} if
_cjkv_type11_tmp /fgid get 1 _cjkv_type11_tmp /lgid get {
- dup _cjkv_type11_tmp /cvidx get add _cjkv_type11_tmp /fgid get sub
- exch _cjkv_type11_tmp /gsubvog get exch .cjkv_getu16
+ dup _cjkv_type11_tmp /cvidx get add _cjkv_type11_tmp /fgid get sub 2 mul
+ _cjkv_type11_tmp /gsubvog get exch .cjkv_getu16
} for
} for >> _cjkv_type11_tmp 3 1 roll put
} {
--- espgs-8.15.4/lib/cjkv/cjkfnmap.ps.exactly-enable-cidfnmap 2007-04-17 11:04:52.000000000 +0100
+++ espgs-8.15.4/lib/cjkv/cjkfnmap.ps 2007-04-17 11:09:56.000000000 +0100
@@ -56,6 +56,11 @@
% Define the name of the CID font map file.
userdict /_cjkv_CIDFontmap 10 dict put
+ /.cjkv_erase_cidfmap_entry {
+ CJKV_DEBUG_FNMAP { (erase cidfmap entry for: ) print dup == } if
+ /CIDFont /Category findresource /.map get exch undef
+ } bind def
+
% <dict> <file> .readCIDFontmap <dict>
% Code from gs_fonts.ps::.readFontmap
/.cjkv_readCIDFontmap {
@@ -67,6 +72,7 @@
( has no associated file or alias name! Giving up.) = flush
{.cjkv_readCIDFontmap} 0 get 1 .quit
} if
+ 1 index .cjkv_erase_cidfmap_entry
dup type dup /stringtype eq exch /nametype eq or not
{ (CIDFontmap entry for ) print 1 index =only
( has an invalid file or alias name! Giving up.) = flush

View File

@ -1,11 +0,0 @@
--- espgs-8.15.3/src/gxcht.c.gxcht-64bit-crash 2007-01-18 12:29:20.000000000 +0000
+++ espgs-8.15.3/src/gxcht.c 2007-01-18 12:29:36.000000000 +0000
@@ -1095,7 +1095,7 @@
ptc->xbits = ((tw - 1) & 7) + 1;
ptc->tdata = btile->data;
ptc->raster = btile->raster;
- ptc->row = ptc->tdata + by * ptc->raster;
+ ptc->row = ptc->tdata + by * (int)ptc->raster;
ptc->data = ptc->row + ptc->xoffset;
ptc->bit_shift = ptc->xshift;
if_debug6('h', "[h]plane %d: size=%d,%d shift=%d bx=%d by=%d\n",

View File

@ -1,23 +1,23 @@
--- espgs-8.15.2/ijs/ijs-config.in.multilib 2006-05-26 13:58:56.000000000 +0100
+++ espgs-8.15.2/ijs/ijs-config.in 2006-05-26 15:01:00.000000000 +0100
@@ -1,7 +1,6 @@
#!/bin/sh
prefix=@prefix@
-libdir=@libdir@
exec_prefix=@exec_prefix@
exec_prefix_set=no
@@ -44,11 +43,7 @@
--- ghostscript-8.60-r8112/ijs/ijs-config.in.multilib 2002-01-31 19:09:46.000000000 +0000
+++ ghostscript-8.60-r8112/ijs/ijs-config.in 2007-07-10 17:46:44.000000000 +0100
@@ -43,8 +43,7 @@
echo $includes
;;
--libs)
- case "x$libdir" in
- x/lib | x/lib64 | x/usr/lib | x/usr/lib64) ;;
- *) libdirs="-L$libdir" ;;
- esac
- libdirs=-L@libdir@
- echo $libdirs -lijs
+ echo -lijs
;;
*)
echo "${usage}" 1>&2
--- ghostscript-8.60-r8112/ijs/Makefile.am.multilib 2007-07-10 18:00:36.000000000 +0100
+++ ghostscript-8.60-r8112/ijs/Makefile.am 2007-07-10 18:00:39.000000000 +0100
@@ -34,7 +34,7 @@
pkgincludedir=$(includedir)/ijs
m4datadir = $(datadir)/aclocal
-pkgconfigdatadir = $(prefix)/lib/pkgconfig
+pkgconfigdatadir = $(libdir)/pkgconfig
lib_LTLIBRARIES = libijs.la

View File

@ -1,23 +1,29 @@
--- espgs-8.15.3/lib/pv.sh.scripts 2006-05-03 00:04:46.000000000 +0100
+++ espgs-8.15.3/lib/pv.sh 2006-11-16 17:05:01.000000000 +0000
@@ -26,7 +26,7 @@
# the -D switch from the call of dvips below.
#
--- ghostscript-8.60-r8112/lib/pv.sh.scripts 2007-07-05 11:41:52.000000000 +0100
+++ ghostscript-8.60-r8112/lib/pv.sh 2007-07-10 16:08:47.000000000 +0100
@@ -31,7 +31,7 @@
GS_EXECUTABLE=gs
TEMPDIR=.
-PAGE=$1
+PAGE="$1"
shift
FILE="$1"
shift
@@ -38,8 +38,8 @@
else
@@ -44,7 +44,7 @@
tmpfile="$TEMPDIR/$FILE.$$.pv"
fi
-trap "rm -rf $tmpfile" 0 1 2 15
-#dvips -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
-dvips -p $PAGE -n 1 "$FILE" "$@" -o "$tmpfile"
+trap 'rm -rf "$tmpfile"' 0 1 2 15
+#dvips -R -D$RESOLUTION -p $PAGE -n 1 $FILE $* -o $FILE.$$.pv
+dvips -R -p "$PAGE" -n 1 "$FILE" "$@" -o "$tmpfile"
gs "$tmpfile"
trap "rm -rf $tmpfile" 0 1 2 15
-#dvips -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
-dvips -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
+#dvips -R -D$RESOLUTION -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
+dvips -R -p $PAGE -n 1 "$FILE" "$@" -o $tmpfile
$GS_EXECUTABLE $tmpfile
exit 0
--- ghostscript-8.60-r8112/lib/dvipdf.scripts 2007-07-10 16:08:57.000000000 +0100
+++ ghostscript-8.60-r8112/lib/dvipdf 2007-07-10 16:09:17.000000000 +0100
@@ -44,4 +44,4 @@
# We have to include the options twice because -I only takes effect if it
# appears before other options.
-exec dvips $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -
+exec dvips -R $DVIPSOPTIONS -q -f "$infile" | $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile="$outfile" $OPTIONS -c .setpdfwrite -

View File

@ -1,23 +0,0 @@
--- espgs-8.15.2/lib/cjkv/cjkfnmap.ps.split-cidfnmap 2006-11-17 16:59:21.000000000 +0000
+++ espgs-8.15.2/lib/cjkv/cjkfnmap.ps 2006-11-17 17:03:39.000000000 +0000
@@ -75,10 +75,17 @@
% stack: dict file cidfontname filename|aliasname
1 index type /stringtype eq
1 index type /nametype eq and 1 index xcheck and
- 1 index /run eq 2 index /.runlibfile eq or and {
+ 1 index /run eq 2 index /.runlibfile eq 3 index /.runlibfileifexists eq or or and {
% This is an inclusion entry.
- pop findlibfile { exch pop } { file } ifelse
- 2 index exch .cjkv_readCIDFontmap pop
+ 0 index /.runlibfileifexists eq {
+ pop findlibfile {
+ exch pop
+ 2 index exch .cjkv_readCIDFontmap pop
+ } { pop } ifelse
+ } {
+ pop findlibfile { exch pop } { file } ifelse
+ 2 index exch .cjkv_readCIDFontmap pop
+ } ifelse
} {
exch dup type /stringtype eq {cvn} if exch
{ 2 index token not

View File

@ -1,16 +1,17 @@
%define gs_ver 8.15.4
%define gs_dot_ver 8.15
%define gs_ver 8.60
%define gs_svn 8117
%define gs_dot_ver 8.60
%{expand: %%define build_with_freetype %{?_with_freetype:1}%{!?_with_freetype:0}}
Summary: A PostScript(TM) interpreter and renderer.
Name: ghostscript
Version: %{gs_ver}
Release: 3%{?dist}
Release: 0.svn%{gs_svn}.1%{?dist}
License: GPL
URL: http://www.cups.org/espgs/
URL: http://www.ghostscript.com/
Group: Applications/Publishing
Source0: ftp://ftp.rz.tu-bs.de/pub/mirror/ftp.easysw.com/ftp/pub/ghostscript/%{?gs_rc:test/}espgs-%{gs_ver}%{?gs_rc:gs_rc}-source.tar.bz2
Source0: ghostscript-%{gs_ver}-r%{gs_svn}.tar.bz2
Source1: FAPIcidfmap
Source2: CIDFnmap
Source4: cidfmap
@ -18,12 +19,8 @@ Source4: cidfmap
Patch1: ghostscript-multilib.patch
Patch2: ghostscript-scripts.patch
Patch3: ghostscript-noopt.patch
Patch4: ghostscript-big-cmap-post.patch
Patch5: ghostscript-split-cidfnmap.patch
Patch6: ghostscript-gxcht-64bit-crash.patch
Patch7: ghostscript-dvipdf.patch
Patch8: ghostscript-Fontmap.local.patch
Patch9: ghostscript-exactly-enable-cidfnmap.patch
Patch4: ghostscript-fPIC.patch
Patch5: http://www.openprinting.org/download/printing/esp-gpl-ghostscript-merge/ghostscript-8.57-ijs-krgb.patch
Requires: urw-fonts >= 1.1, ghostscript-fonts
BuildRequires: libjpeg-devel, libXt-devel
@ -75,7 +72,7 @@ Group: Applications/Publishing
A GTK-enabled version of Ghostscript, called 'gsx'.
%prep
%setup -q -n espgs-%{gs_ver}%{?gs_rc:%gs_rc}
%setup -q -n %{name}-%{gs_ver}-r%{gs_svn}
# Fix ijs-config not to have multilib conflicts (bug #192672)
%patch1 -p1 -b .multilib
@ -86,24 +83,11 @@ A GTK-enabled version of Ghostscript, called 'gsx'.
# Build igcref.c with -O0 to work around bug #150771.
%patch3 -p1 -b .noopt
# Support reading a big cmap/post table from a TrueType font.
%patch4 -p1 -b .big-cmap-post
# Fix shared library build.
%patch4 -p1 -b .fPIC
# Support CIDFnmap inclusion from other files (bug #194592).
%patch5 -p1 -b .split-cidfnmap
# Backported gxcht 64bit crash fix from GPL trunk (bug #177763).
%patch6 -p1 -b .gxcht-64bit-crash
# dvipdf script fixes (bug #88906).
%patch7 -p1 -b .dvipdf
# Allow local overrides for Fontmap (bug #233966).
%patch8 -p1 -b .Fontmap.local
# Apply fonts in CIDFnmap even if the same fontnames are already registered
# (bug #163231).
%patch9 -p1 -b .exactly-enable-cidfnmap
# IJS KRGB patch.
%patch5 -p1 -b .ijs-krgb
# Convert manual pages to UTF-8
from8859_1() {
@ -112,6 +96,13 @@ from8859_1() {
}
for i in man/de/*.1; do from8859_1 "$i"; done
if [ -x autogen.sh ]; then
./autogen.sh
pushd ijs
./autogen.sh
popd
fi
%build
FONTPATH=
for path in \
@ -177,6 +168,10 @@ cd ..
echo ".so man1/gs.1" > $RPM_BUILD_ROOT/%{_mandir}/man1/ghostscript.1
ln -sf gs $RPM_BUILD_ROOT/usr/bin/ghostscript
###
### None of this works at the moment because runlibfileifexists is missing
###
if false; then
# Rename an original FAPIcidfmap to FAPIcidfmap.GS
mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/lib/FAPIcidfmap{,.GS}
# Rename an original cidfmap to cidfmap.GS
@ -186,9 +181,7 @@ mv $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/lib/cidfmap{,.GS}
install -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/lib/FAPIcidfmap
install -m0644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/lib/CIDFnmap
install -m0644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/%{name}/%{gs_dot_ver}/lib/cidfmap
# Don't ship sysvlp.sh.
rm -f $RPM_BUILD_ROOT/usr/bin/sysvlp.sh
fi #false
# Header files.
mkdir -p $RPM_BUILD_ROOT%{_includedir}/ghostscript
@ -243,7 +236,6 @@ rm -rf $RPM_BUILD_ROOT
%dir %{_datadir}/ghostscript/conf.d
%dir %{_datadir}/ghostscript/%{gs_dot_ver}
%dir %{_datadir}/ghostscript/%{gs_dot_ver}/lib
%dir %{_datadir}/ghostscript/%{gs_dot_ver}/lib/cjkv
%config %{_datadir}/ghostscript/%{gs_dot_ver}/lib/gs_init.ps
%config %{_datadir}/ghostscript/%{gs_dot_ver}/lib/Fontmap*
%{_datadir}/ghostscript/%{gs_dot_ver}/Resource/
@ -273,6 +265,15 @@ rm -rf $RPM_BUILD_ROOT
%{_libdir}/libgs.so
%changelog
* Tue Jul 10 2007 Tim Waugh <twaugh@redhat.com> 8.60-0.r8112.1
- 8.60 snapshot from svn. Patches dropped:
- big-cmap-post
- split-cidfnmap
- exactly-enable-cidfnmap
- Fontmap.local
No longer needed:
- gxcht-64bit-crash
* Tue Apr 17 2007 Tim Waugh <twaugh@redhat.com> 8.15.4-3
- Apply fonts in CIDFnmap even if the same fontnames are already registered
(bug #163231).

View File

@ -1,3 +1,3 @@
2fbae60417d42779f6488ab897dcaaf6 acro5-cmaps-2001.tar.gz
dfc93dd2aaaf2b86d2fd55f654c13261 adobe-cmaps-200406.tar.gz
e74e0463e0bfb1cea3db245d8e71828c espgs-8.15.4-source.tar.bz2
aadb7b77e6dc8b759e479660728e8df3 ghostscript-8.60-r8117.tar.bz2