1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 39_pxl-resolution.dpatch by <till.kamppeter@gmail.com>
4
## All lines beginning with `## DP:' are a description of the patch.
8
diff -urNad ghostscript-8.63.dfsg.1~/src/gdevpxut.c ghostscript-8.63.dfsg.1/src/gdevpxut.c
9
--- ghostscript-8.63.dfsg.1~/src/gdevpxut.c 2007-06-07 00:03:27.000000000 +0200
10
+++ ghostscript-8.63.dfsg.1/src/gdevpxut.c 2008-10-13 22:51:58.000000000 +0200
12
San Rafael, CA 94903, U.S.A., +1(415)492-9861, for further information.
15
-/* $Id: gdevpxut.c 8026 2007-06-06 22:03:27Z till $ */
16
+/* $Id: gdevpxut.c 9061 2008-09-02 18:37:07Z till $ */
17
/* Utilities for PCL XL generation */
21
"\033%-12345X@PJL SET RENDERMODE=";
22
static const char *const rendermode_gray = "GRAYSCALE";
23
static const char *const rendermode_color = "COLOR";
24
+ static const char *const pjl_resolution =
25
+ "\n@PJL SET RESOLUTION=";
26
+ static const char *const resolution_150 = "150";
27
+ static const char *const resolution_300 = "300";
28
+ static const char *const resolution_600 = "600";
29
+ static const char *const resolution_1200 = "1200";
30
+ static const char *const resolution_2400 = "2400";
31
static const char *const file_header =
32
"\n@PJL ENTER LANGUAGE = PCLXL\n\
33
) HP-PCL XL;1;1;Comment Copyright Artifex Sofware, Inc. 2005\000\n";
35
px_put_bytes(s, (const byte *)rendermode_color,
36
strlen(rendermode_color));
38
+ px_put_bytes(s, (const byte *)pjl_resolution,
39
+ strlen(pjl_resolution));
41
+ if ((uint) (dev->HWResolution[0] + 0.5) == 150)
42
+ px_put_bytes(s, (const byte *)resolution_150,
43
+ strlen(resolution_150));
44
+ else if ((uint) (dev->HWResolution[0] + 0.5) == 300)
45
+ px_put_bytes(s, (const byte *)resolution_300,
46
+ strlen(resolution_300));
47
+ else if ((uint) (dev->HWResolution[0] + 0.5) == 1200)
48
+ px_put_bytes(s, (const byte *)resolution_1200,
49
+ strlen(resolution_1200));
50
+ else if ((uint) (dev->HWResolution[0] + 0.5) == 2400)
51
+ px_put_bytes(s, (const byte *)resolution_2400,
52
+ strlen(resolution_2400));
54
+ px_put_bytes(s, (const byte *)resolution_600,
55
+ strlen(resolution_600));
56
+ if ((uint) (dev->HWResolution[1] + 0.5) !=
57
+ (uint) (dev->HWResolution[0] + 0.5)) {
58
+ px_put_bytes(s, (const byte *)"x", strlen("x"));
59
+ if ((uint) (dev->HWResolution[1] + 0.5) == 150)
60
+ px_put_bytes(s, (const byte *)resolution_150,
61
+ strlen(resolution_150));
62
+ else if ((uint) (dev->HWResolution[1] + 0.5) == 300)
63
+ px_put_bytes(s, (const byte *)resolution_300,
64
+ strlen(resolution_300));
65
+ else if ((uint) (dev->HWResolution[1] + 0.5) == 1200)
66
+ px_put_bytes(s, (const byte *)resolution_1200,
67
+ strlen(resolution_1200));
68
+ else if ((uint) (dev->HWResolution[1] + 0.5) == 2400)
69
+ px_put_bytes(s, (const byte *)resolution_2400,
70
+ strlen(resolution_2400));
72
+ px_put_bytes(s, (const byte *)resolution_600,
73
+ strlen(resolution_600));
76
/* We have to add 2 to the strlen because the next-to-last */
77
/* character is a null. */
78
px_put_bytes(s, (const byte *)file_header,