1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
|
diff -c -r ../nh2ps-1.0p1-old/nh2ps.1 ./nh2ps.1
*** ../nh2ps-1.0p1-old/nh2ps.1 Tue Jan 28 18:26:01 1997
--- ./nh2ps.1 Wed Apr 2 21:29:12 1997
***************
*** 168,173 ****
--- 168,176 ----
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.
diff -c -r ../nh2ps-1.0p1-old/nh2ps.c ./nh2ps.c
*** ../nh2ps-1.0p1-old/nh2ps.c Fri Jan 31 10:01:27 1997
--- ./nh2ps.c Wed Apr 2 21:32:03 1997
***************
*** 180,191 ****
/*
* Default page dimensions
*/
#ifndef WIDTH
! #define WIDTH 8.27
#endif
#ifndef HEIGHT
! #define HEIGHT 11.64
#endif
#ifndef MARGIN
--- 180,196 ----
/*
* 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 A4_WIDTH
#endif
#ifndef HEIGHT
! #define HEIGHT A4_HEIGHT
#endif
#ifndef MARGIN
***************
*** 408,413 ****
--- 413,421 ----
/*
* 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 */
***************
*** 428,433 ****
--- 436,446 ----
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\" 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");
***************
*** 518,523 ****
--- 531,542 ----
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;
***************
*** 785,792 ****
/*
* This routine buffers a line of input, release one character at a time
* or a whole sequence of characters with some meaning like bold sequences
! * produced by nroff (no others sequences are recognized by the moment):
! * <c><\b><c><\b><c><\b><c>
*/
int
mygetc(statusp)
--- 804,812 ----
/*
* This routine buffers a line of input, release one character at a time
* or a whole sequence of characters with some meaning like bold sequences
! * or underlining produced by nroff.
! * <c><\b><c>
! * <_><\b><c>
*/
int
mygetc(statusp)
***************
*** 814,829 ****
if (buffer[curr+1] != '\b') /* this is not a special sequence */
return buffer[curr++];
! /* Check if it is a bold sequence */
! c = buffer[curr++];
! if (c == buffer[curr+1] &&
! buffer[curr] == buffer[curr+2] &&
! c == buffer[curr+3] &&
! buffer[curr] == buffer[curr+4] &&
! c == buffer[curr+5])
{
*statusp = IS_BOLD;
! curr += 6;
}
/* Return the first character of the sequence */
--- 834,848 ----
if (buffer[curr+1] != '\b') /* this is not a special sequence */
return buffer[curr++];
! /* check if we're underlining */
! if (buffer[curr] == '_')
! return buffer[curr++];
!
! /* Check if it is a bold sequence */
! if ((c = buffer[curr]) == buffer[curr+2])
{
*statusp = IS_BOLD;
! curr += 3;
}
/* Return the first character of the sequence */
***************
*** 1695,1702 ****
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");
--- 1714,1721 ----
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");
***************
*** 2033,2040 ****
/* 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();
--- 2052,2059 ----
/* 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();
diff -c -r ../nh2ps-1.0p1-old/nh2ps_opt ./nh2ps_opt
*** ../nh2ps-1.0p1-old/nh2ps_opt Tue Jan 28 18:26:10 1997
--- ./nh2ps_opt Wed Apr 2 21:27:52 1997
***************
*** 1,4 ****
! #!/usr/local/bin/perl
#
# nh2ps_opt
# - nh2ps hangul, hanja font optimizer
--- 1,4 ----
! #!/usr/bin/perl
#
# nh2ps_opt
# - nh2ps hangul, hanja font optimizer
|