Contents of /trunk/ghostscript-gpl/patches/ghostscript-gpl-9.02-pxl-landscape.patch
Parent Directory | Revision Log
Revision 1374 -
(show annotations)
(download)
Wed Jun 29 12:17:32 2011 UTC (13 years, 3 months ago) by niro
File size: 1573 byte(s)
Wed Jun 29 12:17:32 2011 UTC (13 years, 3 months ago) by niro
File size: 1573 byte(s)
added fedora patches
1 | diff -up ghostscript-9.02/base/gdevpxut.c.pxl-landscape ghostscript-9.02/base/gdevpxut.c |
2 | --- ghostscript-9.02/base/gdevpxut.c.pxl-landscape 2011-04-06 16:40:09.266015684 +0100 |
3 | +++ ghostscript-9.02/base/gdevpxut.c 2011-04-06 16:42:25.134593037 +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 | + } else if (fabs(media_sizes[i].height - w) < 0.05 && |
30 | + fabs(media_sizes[i].width - h) < 0.05 |
31 | + ) { |
32 | + match_found = true; |
33 | + size = media_sizes[i].ms; |
34 | + orientation = eLandscapeOrientation; |
35 | + break; |
36 | } |
37 | /* |
38 | * According to the PCL XL documentation, MediaSize/CustomMediaSize must always |
39 | * be specified, but MediaSource is optional. |
40 | */ |
41 | + px_put_uba(s, orientation, pxaOrientation); |
42 | if (match_found) { |
43 | /* standard media */ |
44 | px_put_uba(s, (byte)size, pxaMediaSize); |