summaryrefslogtreecommitdiff
path: root/fonts/bbold/bbparams.mf
blob: b344ccb1584654cb874b3c8d88f75a1fda255332 (plain)
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
198
199
200
201
202
203
204
205
% Blackboard bold parameters, Alan Jeffrey 14--18 Dec 1989.
%
% These parameters are deduced from those set in bboldNN.mf.
% 
% The only horizontal parameter we take in is the unit u#,
% from which we calculate all the horizontal distances.
%
% The distance between the two strokes in a fat line is fatness.

fatness# := 2.3u#;

% The size of a pen is rule_thickness.

pen_size# := rule_thickness#;

% Characters with space inside them (for example the
% gap between the bar and the dot in a ! have either smallspace, 
% space# or bigspace# worth of space.

smallspace# := u#;
space# := 2u#;
bigspace# := 3u#;

% Characters with bits jutting out of them (for example the feet in
% ] or the bar in f) have jut# worth of stick-outiness.

jut# := 1.5u#;
bigjut# := 2.5u#;

% Some characters are exactly fatness# + pen_size# wide, as they are
% drawn with just one vertical line.
%
%    tiny --- I, i, l, |, ,, :, ;, ., `, ', !.
%
% Others have a small amount jutting out from the side, like the 
% top and bottom of a ].
%
%    tiny+jut --- [, ], (, ).

tiny# := fatness# + pen_size#;

% Upper case characters come in three sizes:
%
%    small --- B, E, F, J, K, L, P, R, S,  Gamma, Pi, ?, $, /, \,
%
%    medium --- A, C, D, G, H, M, N, O, Q, T, U, V, X, Y, Z,
%               Delta, Theta, Lamba, Xi, Sigma, Upsilon, Phi, Psi, Omega,
%
%    big --- W.

smallcap# := 9u#;
medcap# := 10u#;
bigcap# := 14u#;

% Lower case characters come in three sizes:
%
%    small --- f, j, s, t,
%
%    small + fatness --- h, k, n, r,
%
%    medium --- a, c, d, e, g, o, q, u, v, x, y, z,
%
%    medium + fatness --- b, p,
%
%    big --- m, w.
%
% The letters with verticals at the left have fatness added on
% so that the curves are the same size as the other letters.

smalllower# := 6u#;
medlower# := 7.5u#;
biglower# := 11u#;

% Numerals are all the same size.

numeral# := 8u#;

% Arithmetic operators (in this case just +) are all the same size.

arithmetic# := 12u#;

% Characters have three kinds of space at the side:
%
%   small --- for example around a T,
%
%   medium --- for example around an O,
%
%   large --- for example around an I.

smallgap# := 1/2u#;
medgap# := 1u#;
biggap# := 1.5u#;

% Whereas we've only got one horizontal measurement stolen from cmr,
% there are lots of vertical ones.  We can use these to work out 
% our measurements.
%
% Characters can have various top positions:
%
%   ATop --- the top of all capitals, Greek, and some punctuation,
%   
%   aTop --- the top of lower case without ascenders,
%
%   bTop --- the top of lower case with ascenders,
%
%   iTop --- the top of i and j,
%
%   oneTop --- the top of numerals,
%
%   bracketTop --- the top of a bracket (also the top of the body size).

ATop# := cap_height#;
aTop# := x_height#;
bTop# := asc_height#;
oneTop# := fig_height#;
bracketTop# := body_height#;
iTop# := min(x_height# + space# + fatness#, asc_height#); 

% The bottoms of characters can be:
%
%   aBottom --- the base line,
%
%   gBottom --- the bottom of a descender,
%
%   bracketBottom --- the bottom of a bracket (also the bottom of the body).

aBottom# := 0pt#;
gBottom# := -desc_depth#;
.5 [bracketBottom#, bracketTop#] = math_axis#; % Brackets are centered.

% Various characters such as A, B, G, e, and 3 have bars in them.

ABar# := .25 [aBottom#, ATop#];
BBar# := .52 [aBottom#, ATop#];       % number nicked from cmr.
GBar# := .50 [aBottom#, ATop#];
eBar# := bar_height#;
threeBar# := .54[aBottom#, oneTop#];  % number nicked from cmr.

% The top of a Q's tail is at QTailTop, and the bottom is at QTailBottom.

QTailTop# := .28 [aBottom#, ATop#];     % number nicked from cmr.
QTailBottom# := aBottom# - comma_depth#; % number nicked from cmr.

% Various sorts of letters have various amounts of curl in them.
%
%    CCurl --- the amount the end of a C curls,
%    cCurl --- the amount the end of a c curls,
%    gCurl --- the amount the tail of a g curls,
%    hCurl --- the distance from the bottom of an h to the point where
%              the right of the curve becomes vertical.

CCurl# := .2 (ATop# - aBottom#);
cCurl# := .2 (aTop# - aBottom#);
gCurl# := .2 (aBottom# - gBottom#);
hCurl# := .4 (aTop# - aBottom#);

% The numbers five, six and eight have bowls, which are sixBowl# tall.

sixBowl# := aTop# - aBottom#;   % These bowls are as tall as an a.

% A less than (and a greater than) is lessthan# tall.

lessthan# := math_spread [5/4x_height#, 3/2x_height#]; % Numbers from cmr.

% Right, I'll now turn these nice sharp measurements into grotty 
% approximate pixelly ones.

define_corrected_pixels (o);

define_whole_blacker_pixels 
   (pen_size);

define_whole_pixels 
   (fatness, jut, bigjut, smallspace, space, bigspace);

define_whole_vertical_pixels
   (CCurl, cCurl, gCurl, hCurl, sixBowl);

define_whole_top_pixels 
   (ATop, aTop, bTop, oneTop, bracketTop, QTailTop);

define_whole_bottom_pixels 
   (QTailBottom, aBottom, gBottom, bracketBottom);

pickup pencircle scaled pen_size;
define_good_y_pixels
   (ABar, BBar, GBar, eBar, threeBar);

% And now some handy numbers, which I don't need sharp versions of.

aMiddle := .5[aBottom, aTop];
dashMiddle := .61803 [aBottom, aTop]; % Number stolen from cmr.

% I can now set the font parameters for the TFM files, stolen from cmr.

font_normal_space := 6u#;
font_normal_stretch := 3u#;
font_normal_shrink := 2u#;
font_quad := 18u#;
font_extra_space := 2u#;
font_x_height := x_height#;

% And that's that.