10 #include "Dimensions.h"
13 * Get page and other dimensions before printing.
16 floatish borderheight = BORDER_HEIGHT;
17 floatish borderwidth = BORDER_WIDTH;
18 floatish borderspace = BORDER_SPACE;
19 floatish borderthick = BORDER_THICK;
21 floatish titlewidth = (BORDER_WIDTH - (2 * BORDER_SPACE));
22 floatish titletextspace = TITLE_TEXT_SPACE;
25 floatish graphx0 = GRAPH_X0;
26 floatish graphy0 = GRAPH_Y0;
31 static floatish KeyWidth PROTO((void)); /* forward */
38 xrange = samplemap[nsamples - 1] - samplemap[0];
39 xrange = max(xrange, auxxrange);
40 if (xrange == 0.0) xrange = 1.0; /* avoid division by 0.0 */
42 yrange = MaxCombinedHeight();
43 yrange = max(yrange, auxyrange);
44 if (yrange == 0.0) yrange = 1.0; /* avoid division by 0.0 */
46 if (!bflag && !sflag) {
47 bflag = strlen(jobstring) > SMALL_JOB_STRING_WIDTH;
51 titleheight = 2 * TITLE_HEIGHT;
53 titleheight = TITLE_HEIGHT;
56 keyOnGraph = !multipageflag && TWENTY != 0;
57 graphwidth = titlewidth - graphx0 - (keyOnGraph ? KeyWidth() : 0);
58 graphheight = borderheight - titleheight - (2 * borderspace) - graphy0;
62 * Calculate the width of the key.
73 for (i = 0; i < nidents; i++) {
74 c = max(c, StringSize(identtable[i]->name));
77 c += 3.0 * borderspace;
79 c += (floatish) KEY_BOX_WIDTH;
86 * A desperately grim solution.
90 floatish fonttab[] = {
100 /* 29 (')') = */ 3.0,
101 /* 2a ('*') = */ 2.0,
102 /* 2b ('+') = */ 3.0,
103 /* 2c (',') = */ 1.0,
104 /* 2d ('-') = */ 3.0,
105 /* 2e ('.') = */ 1.0,
106 /* 2f ('/') = */ 3.0,
107 /* 30 ('0') = */ 4.0,
108 /* 31 ('1') = */ 4.0,
109 /* 32 ('2') = */ 4.0,
110 /* 33 ('3') = */ 4.0,
111 /* 34 ('4') = */ 4.0,
112 /* 35 ('5') = */ 4.0,
113 /* 36 ('6') = */ 4.0,
114 /* 37 ('7') = */ 4.0,
115 /* 38 ('8') = */ 4.0,
116 /* 39 ('9') = */ 4.0,
117 /* 3a (':') = */ 1.0,
118 /* 3b (';') = */ 1.0,
119 /* 3c ('<') = */ 3.0,
120 /* 3d ('=') = */ 3.0,
121 /* 3e ('>') = */ 3.0,
122 /* 3f ('?') = */ 2.0,
123 /* 40 ('@') = */ 3.0,
124 /* 41 ('A') = */ 5.0,
125 /* 42 ('B') = */ 5.0,
126 /* 43 ('C') = */ 5.0,
127 /* 44 ('D') = */ 5.0,
128 /* 45 ('E') = */ 5.0,
129 /* 46 ('F') = */ 5.0,
130 /* 47 ('G') = */ 5.0,
131 /* 48 ('H') = */ 5.0,
132 /* 49 ('I') = */ 1.0,
133 /* 4a ('J') = */ 5.0,
134 /* 4b ('K') = */ 5.0,
135 /* 4c ('L') = */ 5.0,
136 /* 4d ('M') = */ 5.0,
137 /* 4e ('N') = */ 5.0,
138 /* 4f ('O') = */ 5.0,
139 /* 50 ('P') = */ 5.0,
140 /* 51 ('Q') = */ 5.0,
141 /* 52 ('R') = */ 5.0,
142 /* 53 ('S') = */ 5.0,
143 /* 54 ('T') = */ 5.0,
144 /* 55 ('U') = */ 5.0,
145 /* 56 ('V') = */ 5.0,
146 /* 57 ('W') = */ 5.0,
147 /* 58 ('X') = */ 5.0,
148 /* 59 ('Y') = */ 5.0,
149 /* 5a ('Z') = */ 5.0,
150 /* 5b ('[') = */ 2.0,
151 /* 5c ('\') = */ 3.0,
152 /* 5d (']') = */ 2.0,
153 /* 5e ('^') = */ 1.0,
154 /* 5f ('_') = */ 3.0,
155 /* 60 ('`') = */ 1.0,
156 /* 61 ('a') = */ 3.0,
157 /* 62 ('b') = */ 3.0,
158 /* 63 ('c') = */ 3.0,
159 /* 64 ('d') = */ 3.0,
160 /* 65 ('e') = */ 3.0,
161 /* 66 ('f') = */ 3.0,
162 /* 67 ('g') = */ 3.0,
163 /* 68 ('h') = */ 3.0,
164 /* 69 ('i') = */ 1.0,
165 /* 6a ('j') = */ 2.0,
166 /* 6b ('k') = */ 3.0,
167 /* 6c ('l') = */ 1.0,
168 /* 6d ('m') = */ 5.0,
169 /* 6e ('n') = */ 3.0,
170 /* 6f ('o') = */ 3.0,
171 /* 70 ('p') = */ 3.0,
172 /* 71 ('q') = */ 3.0,
173 /* 72 ('r') = */ 2.0,
174 /* 73 ('s') = */ 3.0,
175 /* 74 ('t') = */ 2.0,
176 /* 75 ('u') = */ 3.0,
177 /* 76 ('v') = */ 3.0,
178 /* 77 ('w') = */ 3.0,
179 /* 78 ('x') = */ 3.0,
180 /* 79 ('y') = */ 3.0,
181 /* 7a ('z') = */ 3.0,
182 /* 7b ('{') = */ 2.0,
183 /* 7c ('|') = */ 1.0,
184 /* 7d ('}') = */ 2.0,
190 * What size is a string (in points)?
193 #define FUDGE (2.834646 * 0.6)
201 for (r = 0.0; *s; s++) {
202 r += fonttab[(*s) - 0x20];