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