From owner-freebsd-hackers Sun Feb 19 17:11:05 1995 Return-Path: hackers-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id RAA21343 for hackers-outgoing; Sun, 19 Feb 1995 17:11:05 -0800 Received: (from julian@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id RAA21289; Sun, 19 Feb 1995 17:09:43 -0800 Date: Sun, 19 Feb 1995 17:09:43 -0800 From: Julian Elischer Message-Id: <199502200109.RAA21289@freefall.cdrom.com> To: M.Santana@frgu.bull.fr Subject: hmm slightly better patch Cc: hackers Sender: hackers-owner@FreeBSD.org Precedence: bulk I must have been very sleepy here is a cleaner patch for USA paper sizes in a2ps. the -a option is still use 8.5 x 11 but I used teh symbolic names this time :) julian To the FreeBSD crew.. how do I put this patch into our a2ps port? =================================================================== RCS file: RCS/a2ps.c,v retrieving revision 1.1 diff -c -r1.1 a2ps.c *** 1.1 1995/02/20 00:28:47 --- a2ps.c 1995/02/20 01:05:32 *************** *** 166,175 **** --- 166,177 ---- */ #ifndef WIDTH #define WIDTH 8.27 + #define USA_WIDTH 8.5 #endif #ifndef HEIGHT #define HEIGHT 11.64 + #define USA_HEIGHT 11.0 #endif #ifndef MARGIN *************** *** 362,367 **** --- 364,371 ---- /* * 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,387 **** --- 386,392 ---- 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"); + fprintf(stderr," -a\t\tUse USA paper size (8.5 x 11)\n"); 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,469 **** --- 469,478 ---- usage(EXIT_FAILURE); interpret = TRUE; break; + case 'a': /* American paper sizes */ + paper_height = USA_HEIGHT; + paper_width = USA_WIDTH; + break; case 'n': if (arg[2] == NUL) return; *************** *** 1471,1478 **** 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("/margin %g inch def\n", (double)MARGIN); printf("/rm margin 3 div def\n"); printf("/lm margin 2 mul 3 div def\n"); --- 1480,1487 ---- printf("\n%% Initialize page description variables.\n"); printf("/x0 0 def\n"); printf("/y0 0 def\n"); ! 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,1801 **** /* 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; /* Postcript prologue printing */ print_prologue(); --- 1803,1810 ---- /* Initialize variables not depending of positional options */ landscape = twinpages = -1; /* To force format switching */ fontsize = -1.0; /* To force fontsize switching */ ! page_height = (double)(paper_height - MARGIN) * PIXELS_INCH; ! page_width = (double)(paper_width - MARGIN) * PIXELS_INCH; /* Postcript prologue printing */ print_prologue(); =================================================================== RCS file: RCS/a2ps.1,v retrieving revision 1.1 diff -c -r1.1 a2ps.1 *** 1.1 1995/02/20 00:42:22 --- a2ps.1 1995/02/20 00:43:52 *************** *** 155,160 **** --- 155,163 ---- is the number of copies desired of each file named. By default, you get only one copy. .TP 0.6i + .B -a + Use the American paper size (8.5" x 11") as the basis for all calculations. + .TP 0.6i .B -d Print the current date and time at the bottom of the page. This option is affected by the no surrounding border and the no header options. end of email