Magellan Linux

Annotation of /trunk/ghostscript-gpl/patches/ghostscript-gpl-9.04-pxl-landscape.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1571 - (hide annotations) (download)
Thu Nov 24 20:03:23 2011 UTC (12 years, 5 months ago) by niro
File size: 1631 byte(s)
-rediffed
1 niro 1571 diff -up ghostscript-9.04rc1/base/gdevpxut.c.pxl-landscape ghostscript-9.04rc1/base/gdevpxut.c
2     --- ghostscript-9.04rc1/base/gdevpxut.c.pxl-landscape 2011-07-29 10:42:51.000000000 +0100
3     +++ ghostscript-9.04rc1/base/gdevpxut.c 2011-08-01 12:34:54.201815802 +0100
4     @@ -115,11 +115,7 @@ px_write_file_header(stream *s, const gx
5     int
6     px_write_page_header(stream *s, const gx_device *dev)
7     {
8     - static const byte page_header_1[] = {
9     - DUB(ePortraitOrientation), DA(pxaOrientation)
10     - };
11     -
12     - PX_PUT_LIT(s, page_header_1);
13     + /* Orientation is deferred until px_write_select_media... */
14     return 0;
15     }
16    
17     @@ -145,6 +141,7 @@ px_write_select_media(stream *s, const g
18     int i;
19     pxeMediaSize_t size = eDefaultPaperSize;
20     byte tray = eAutoSelect;
21     + byte orientation = ePortraitOrientation;
22     bool match_found = false;
23    
24     /* The default is eDefaultPaperSize (=96), but we'll emit CustomMediaSize */
25     @@ -156,11 +153,19 @@ px_write_select_media(stream *s, const g
26     match_found = true;
27     size = media_sizes[i].ms;
28     break;
29     - }
30     + } else if (fabs(media_sizes[i].height - w) < 0.05 &&
31     + fabs(media_sizes[i].width - h) < 0.05
32     + ) {
33     + match_found = true;
34     + size = media_sizes[i].ms;
35     + orientation = eLandscapeOrientation;
36     + break;
37     + }
38     /*
39     * According to the PCL XL documentation, MediaSize/CustomMediaSize must always
40     * be specified, but MediaSource is optional.
41     */
42     + px_put_uba(s, orientation, pxaOrientation);
43     if (match_found) {
44     /* standard media */
45     px_put_uba(s, (byte)size, pxaMediaSize);