mirror of
https://git.FreeBSD.org/ports.git
synced 2024-11-14 23:46:10 +00:00
5c87441d03
flags. This now matches the manpage. PR: 3958
93 lines
3.1 KiB
Plaintext
93 lines
3.1 KiB
Plaintext
--- a2ps.c.orig Tue Feb 15 01:14:59 1994
|
|
+++ a2ps.c Sun May 9 13:46:38 1999
|
|
@@ -1,4 +1,3 @@
|
|
-/************************************************************************/
|
|
/* */
|
|
/* Description: Ascii to PostScript printer program. */
|
|
/* File: bounty:/archive/src/a2ps/Last/a2ps.c */
|
|
@@ -164,12 +163,17 @@
|
|
/*
|
|
* Default page dimensions
|
|
*/
|
|
+#define USA_WIDTH 8.5
|
|
+#define USA_HEIGHT 11.0
|
|
+#define A4_WIDTH 8.27
|
|
+#define A4_HEIGHT 11.64
|
|
+
|
|
#ifndef WIDTH
|
|
-#define WIDTH 8.27
|
|
+#define WIDTH A4_WIDTH
|
|
#endif
|
|
|
|
#ifndef HEIGHT
|
|
-#define HEIGHT 11.64
|
|
+#define HEIGHT A4_HEIGHT
|
|
#endif
|
|
|
|
#ifndef MARGIN
|
|
@@ -311,7 +315,7 @@
|
|
int login_id = TRUE; /* Print login ID at top of page */
|
|
#endif
|
|
#if LPR_PRINT
|
|
-int lpr_print = TRUE; /* Fork a lpr process to do the printing */
|
|
+int lpr_print = FALSE; /* Fork a lpr process to do the printing */
|
|
#ifdef RECTO_VERSO_PRINTING
|
|
int rectoverso = TWOSIDED_DFLT; /* Two-side printing */
|
|
#endif
|
|
@@ -362,6 +366,8 @@
|
|
/*
|
|
* Sheet dimensions
|
|
*/
|
|
+double paper_height = HEIGHT; /* Paper height */
|
|
+double paper_width = WIDTH; /* Paper width */
|
|
double page_height = HEIGHT; /* Paper height */
|
|
double page_width = WIDTH; /* Paper width */
|
|
|
|
@@ -382,6 +388,11 @@
|
|
fprintf(stderr,"pos. = -#num\t\tnumber of copies to print\n");
|
|
fprintf(stderr," -1\t\tone page per sheet\n");
|
|
fprintf(stderr," -2\t\tTWIN PAGES per sheet\n");
|
|
+#if A4_PAPERSIZE == 1
|
|
+ fprintf(stderr," -a\t\tUse USA paper size (8.5\" x 11\")\n");
|
|
+#else
|
|
+ fprintf(stderr," -a\t\tUse A4 paper size (21cm x 29.56cm (8.27\" x 11.64\"))\n");
|
|
+#endif
|
|
fprintf(stderr," -d\t-nd\tprint (DON'T PRINT) current date at the bottom\n");
|
|
fprintf(stderr," -Fnum\t\tfont size, num is a float number\n");
|
|
fprintf(stderr," -Hstr\t\tuse str like header title for subsequent files\n");
|
|
@@ -464,6 +475,12 @@
|
|
usage(EXIT_FAILURE);
|
|
interpret = TRUE;
|
|
break;
|
|
+ case 'a': /* American paper sizes */
|
|
+#if defined(USA_HEIGHT) && defined(USA_WIDTH)
|
|
+ paper_height = USA_HEIGHT;
|
|
+ paper_width = USA_WIDTH;
|
|
+# endif
|
|
+ break;
|
|
case 'n':
|
|
if (arg[2] == NUL)
|
|
return;
|
|
@@ -1471,8 +1488,8 @@
|
|
printf("\n%% Initialize page description variables.\n");
|
|
printf("/x0 0 def\n");
|
|
printf("/y0 0 def\n");
|
|
- printf("/sh %g inch def\n", (double)HEIGHT);
|
|
- printf("/sw %g inch def\n", (double)WIDTH);
|
|
+ printf("/sh %g inch def\n", (double)paper_height);
|
|
+ printf("/sw %g inch def\n", (double)paper_width);
|
|
printf("/margin %g inch def\n", (double)MARGIN);
|
|
printf("/rm margin 3 div def\n");
|
|
printf("/lm margin 2 mul 3 div def\n");
|
|
@@ -1794,8 +1811,8 @@
|
|
/* Initialize variables not depending of positional options */
|
|
landscape = twinpages = -1; /* To force format switching */
|
|
fontsize = -1.0; /* To force fontsize switching */
|
|
- page_height = (double)(HEIGHT - MARGIN) * PIXELS_INCH;
|
|
- page_width = (double)(WIDTH - MARGIN) * PIXELS_INCH;
|
|
+ page_height = (double)(paper_height - MARGIN) * PIXELS_INCH;
|
|
+ page_width = (double)(paper_width - MARGIN) * PIXELS_INCH;
|
|
|
|
/* Postcript prologue printing */
|
|
print_prologue();
|