aboutsummaryrefslogtreecommitdiff
path: root/graphics/tiff/files
diff options
context:
space:
mode:
authorMaxim Sobolev <sobomax@FreeBSD.org>2001-11-23 18:03:41 +0000
committerMaxim Sobolev <sobomax@FreeBSD.org>2001-11-23 18:03:41 +0000
commit5c5c6f155b28a8cd44c2478c7e155ab38bda9f5d (patch)
tree187387b4a73d3521084b7c785c22c7c15dce0f72 /graphics/tiff/files
parentd463c9e7db582b57412055b992cfffa6cf8a5a90 (diff)
Tech fax2ps(1) how to work properly for non-Letter paper sizes.
PR: 32018 Submitted by: Helge Oldach <send-pr@oldach.net>
Notes
Notes: svn path=/head/; revision=50426
Diffstat (limited to 'graphics/tiff/files')
-rw-r--r--graphics/tiff/files/patch-tools::fax2ps.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/graphics/tiff/files/patch-tools::fax2ps.c b/graphics/tiff/files/patch-tools::fax2ps.c
new file mode 100644
index 000000000000..64fa98e675bd
--- /dev/null
+++ b/graphics/tiff/files/patch-tools::fax2ps.c
@@ -0,0 +1,42 @@
+
+--- tools/fax2ps.c.orig Tue Sep 2 19:54:34 1997
++++ tools/fax2ps.c Sat Feb 13 16:43:01 1999
+@@ -151,7 +151,7 @@
+ {
+ uint32 w, h;
+ uint16 unit;
+- float xres, yres;
++ float xres, yres, scale = 1.0;
+ tstrip_t s, ns;
+
+ TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
+@@ -174,21 +174,13 @@
+
+ printf("%%%%Page: \"%d\" %d\n", pageNumber, pageNumber);
+ printf("/$pageTop save def gsave\n");
+- if (scaleToPage) {
+- float yscale = pageHeight / (h/yres);
+- float xscale = pageWidth / (w/xres);
+- printf("%d %d translate\n",
+- (int) (((basePageWidth - pageWidth) * points) * half),
+- (int)((yscale*(h/yres)*points) +
+- (basePageHeight - pageHeight) * points * half) );
+- printf("%g %g scale\n", (72.*xscale)/xres, -(72.*yscale)/yres);
+- } else {
+- printf("%d %d translate\n",
+- (int) ((basePageWidth - pageWidth) * points * half),
+- (int)((72.*h/yres) +
+- (basePageHeight - pageHeight) * points * half) );
+- printf("%g %g scale\n", 72./xres, -72./yres);
+- }
++ if (scaleToPage)
++ scale = pageHeight / (h/yres) < pageWidth / (w/xres) ?
++ pageHeight / (h/yres) : pageWidth / (w/xres);
++ printf("%g %g translate\n",
++ points * (pageWidth - scale*w/xres) * half,
++ points * (scale*h/yres + (pageHeight - scale*h/yres) * half));
++ printf("%g %g scale\n", points/xres*scale, -points/yres*scale);
+ printf("0 setgray\n");
+ TIFFSetField(tif, TIFFTAG_FAXFILLFUNC, printruns);
+ ns = TIFFNumberOfStrips(tif);
+