From a65b257eae98991c703b74b639f437c24e3328d2 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Wed, 6 Apr 2011 16:43:40 +0100 Subject: [PATCH] pxl: match landscape page sizes (bug #692165). --- ghostscript-pxl-landscape.patch | 44 +++++++++++++++++++++++++++++++++ ghostscript.spec | 9 ++++++- 2 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 ghostscript-pxl-landscape.patch diff --git a/ghostscript-pxl-landscape.patch b/ghostscript-pxl-landscape.patch new file mode 100644 index 0000000..c8d5f58 --- /dev/null +++ b/ghostscript-pxl-landscape.patch @@ -0,0 +1,44 @@ +diff -up ghostscript-9.02/base/gdevpxut.c.pxl-landscape ghostscript-9.02/base/gdevpxut.c +--- ghostscript-9.02/base/gdevpxut.c.pxl-landscape 2011-04-06 16:40:09.266015684 +0100 ++++ ghostscript-9.02/base/gdevpxut.c 2011-04-06 16:42:25.134593037 +0100 +@@ -115,11 +115,7 @@ px_write_file_header(stream *s, const gx + int + px_write_page_header(stream *s, const gx_device *dev) + { +- static const byte page_header_1[] = { +- DUB(ePortraitOrientation), DA(pxaOrientation) +- }; +- +- PX_PUT_LIT(s, page_header_1); ++ /* Orientation is deferred until px_write_select_media... */ + return 0; + } + +@@ -145,6 +141,7 @@ px_write_select_media(stream *s, const g + int i; + pxeMediaSize_t size = eDefaultPaperSize; + byte tray = eAutoSelect; ++ byte orientation = ePortraitOrientation; + bool match_found = false; + + /* The default is eDefaultPaperSize (=96), but we'll emit CustomMediaSize */ +@@ -156,11 +153,19 @@ px_write_select_media(stream *s, const g + match_found = true; + size = media_sizes[i].ms; + break; ++ } else if (fabs(media_sizes[i].height - w) < 0.05 && ++ fabs(media_sizes[i].width - h) < 0.05 ++ ) { ++ match_found = true; ++ size = media_sizes[i].ms; ++ orientation = eLandscapeOrientation; ++ break; + } + /* + * According to the PCL XL documentation, MediaSize/CustomMediaSize must always + * be specified, but MediaSource is optional. + */ ++ px_put_uba(s, orientation, pxaOrientation); + if (match_found) { + /* standard media */ + px_put_uba(s, (byte)size, pxaMediaSize); diff --git a/ghostscript.spec b/ghostscript.spec index ce7f9ae..fafb31e 100644 --- a/ghostscript.spec +++ b/ghostscript.spec @@ -5,7 +5,7 @@ Summary: A PostScript interpreter and renderer Name: ghostscript Version: %{gs_ver} -Release: 1%{?dist} +Release: 2%{?dist} # Included CMap data is Redistributable, no modification permitted, # see http://bugzilla.redhat.com/487510 @@ -29,6 +29,7 @@ Patch21: ghostscript-jbig2-image-refcount.patch Patch27: ghostscript-Fontmap.local.patch Patch28: ghostscript-iccprofiles-initdir.patch Patch29: ghostscript-gdevcups-debug-uninit.patch +Patch30: ghostscript-pxl-landscape.patch Requires: urw-fonts >= 1.1, ghostscript-fonts Requires: poppler-data @@ -150,6 +151,9 @@ rm -rf libpng zlib jpeg jasper # gdevcups: don't use uninitialized variables in debugging output. %patch29 -p1 -b .gdevcups-debug-uninit +# pxl: match landscape page sizes (bug #692165). +%patch30 -p1 -b .pxl-landscape + # Convert manual pages to UTF-8 from8859_1() { iconv -f iso-8859-1 -t utf-8 < "$1" > "${1}_" @@ -342,6 +346,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libgs.so %changelog +* Wed Apr 6 2011 Tim Waugh 9.02-2 +- pxl: match landscape page sizes (bug #692165). + * Mon Apr 4 2011 Tim Waugh - Fixed source URL.