pxl: match landscape page sizes (bug #692165).

This commit is contained in:
Tim Waugh 2011-04-06 16:43:40 +01:00
parent 2ac3edf665
commit a65b257eae
2 changed files with 52 additions and 1 deletions

View File

@ -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);

View File

@ -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 <twaugh@redhat.com> 9.02-2
- pxl: match landscape page sizes (bug #692165).
* Mon Apr 4 2011 Tim Waugh <twaugh@redhat.com>
- Fixed source URL.