Debian Codegraph @

texmf-dist/fonts/source/public/ruscap/ruscap10.mf

raw
1 % ruscap10.mf
2 % Version 1.0
3 % Copyright (c) 2024, Victor Sannier with Reserved Font Name ruscap.
4 % This Font Software is licensed under the SIL Open Font License, Version 1.1.
5
6 font_size 10pt#;
7 font_quad 13pt#;
8
9 u# := 10/12 pt#; % unit
10 s# := 2/3 u#; % sidebearing
11 o# := 1/4 u#; % overshoot
12
13 % Heights
14 cap_height# := 9 u#;
15 asc_height# := 11 u#;
16 desc_height# := 1 u#;
17 crossbar_height# := 5 u#;
18
19 diag_angle := 90 + 35;
20 spur_width# := 1/2 u#;
21 spur_angle := 35;
22
23 % Pen
24 thick# := 5/4 u#;
25 thin# := 1/3 u#;
26 pen_angle := 65;
27
28 % Serif
29 serif_width# := 5/2 u#;
30 serif_angle := 90 / 6;
31
32 mode_setup;
33
34 o_width# := 6u#;
35 e# := 1/3 u#;
36
37 define_pixels(u, s);
38 define_whole_pixels(serif_width, spur_width, o_width);
39 define_whole_vertical_pixels(cap_height, asc_height, desc_height);
40 define_blacker_pixels(thick, thin);
41 define_good_y_pixels(crossbar_height);
42 define_corrected_pixels(o, e);
43
44 pickup pensquare xscaled thick yscaled thin rotated pen_angle;
45 rustic_pen := savepen;
46
47 font_slant 0;
48 font_normal_space 3/4 o_width#;
49 font_normal_stretch 1/3 o_width#;
50 font_normal_shrink 1/2 o_width#;
51 font_x_height cap_height#;
52
53 % Macros
54
55 def draw_serif(suffix i, j)(expr width) =
56 rt x.j - lft x.i = width; y.i = y.j;
57 draw z.i{dir serif_angle} .. {dir serif_angle}z.j;
58 enddef;
59
60 def draw_diag_stroke(suffix i, j)(expr angle) =
61 z.i - z.i.l = z.j.r - z.j = spur_width * dir spur_angle;
62 z.j - z.i = whatever * (dir angle);
63 draw z.i.l .. z.i .. tension 3 .. z.j .. z.j.r;
64 enddef;
65
66 def draw_I(suffix i, j, k, l)(expr sw) =
67 x.i = x.j; % vertical stem
68 top y.i = h + o; bot y.j = 0;
69 z.i - z.i.l
70 = spur_width * dir spur_angle;
71
72 % Serif
73 rt (2 x.j - x.k) - lft x.k = serif_width;
74 y.j = y.k;
75 draw_serif(k, l)(sw);
76
77 draw z.i.l .. z.i .. tension 5 .. z.j;
78 enddef;
79
80 def draw_P(suffix i, j, k, l, m)(expr w) =
81 lft x.k = s;
82 draw_I(i, j, k, l)(serif_width);
83 rt x.m = w - s;
84 y.m = crossbar_height + 1/2 (cap_height - crossbar_height);
85 draw z.i{right} .. z.m .. {left}(x.i + e, crossbar_height);
86 enddef;
87
88 % Characters
89
90 beginchar("A", 8u# + 2u#, cap_height#, 0);
91 "Rustic A";
92 pickup rustic_pen;
93
94 top y1 = h + o; bot y2 = -o; rt x2.r = w - s;
95 draw_diag_stroke(1, 2)(diag_angle);
96
97 lft x5 = s; bot y5 = 0;
98 z3 = 1/5 [z1, z2];
99 z4 = 1/2 [z5, z6];
100 draw_serif(5, 6)(serif_width);
101 draw z3 .. z4;
102
103 labels(range 1 thru 6);
104 labels(1.l, 2.r);
105 endchar;
106
107 beginchar("B", 5u# + 2s#, cap_height#, 0);
108 "Rustic B";
109 pickup rustic_pen;
110 draw_P(1, 2, 3, 4, 5)(5u);
111 rt x6 = w - s; y6 = crossbar_height / 2;
112 draw (x1, crossbar_height){right} .. z6 .. {left}z4;
113 labels(range 1 thru 6);
114 endchar;
115
116 beginchar("C", 5u# + 2s#, cap_height#, 0);
117 "Rustic C";
118 pickup rustic_pen;
119 rt x1 = w - s; y1 = (crossbar_height + cap_height) / 2;
120 x2 = w / 2; top y2 = h + o;
121 lft x3 = s; y3 = cap_height - crossbar_height;
122 x4 = w / 2; bot y4 = 0;
123 rt x5 = w - s; bot y5 = 0;
124 draw z1 .. z2 .. z3.. z4 .. {right}z5;
125 labels(range 1 thru 5);
126 endchar;
127
128 beginchar("D", 5u# + 2s#, cap_height#, 0);
129 "Rustic D";
130 pickup rustic_pen;
131 lft x3 = s;
132 draw_I(1, 2, 3, 4)(serif_width);
133 rt x5 = w - s; y5 = crossbar_height;
134 draw z1{right} .. z5 .. {left}z4;
135 labels(range 1 thru 5);
136 endchar;
137
138 def draw_EF =
139 pickup rustic_pen;
140 % Top stroke
141 lft x1 = s; top y1 = h;
142 rt x2 = w - s; top y2 = h;
143 draw z1{dir serif_angle} .. {dir serif_angle}z2;
144 % Down stroke
145 rt (2 x5 - x1) - lft x1 = serif_width;
146 x6 = x5; top y5 = h; bot y6 = 0;
147 draw z5 .. z6;
148 % Bottom stroke
149 lft x3 = s; bot y3 = 0; bot y4 = 0;
150 draw z3{dir serif_angle} .. {dir serif_angle}z4;
151 % Middle stroke
152 z7 = (x5, crossbar_height); z8 = (x2, crossbar_height);
153 draw z7 .. z8;
154 labels(range 1 thru 8);
155 enddef;
156
157 beginchar("E", 3.5u# + 2s#, cap_height#, 0);
158 "Rustic E";
159 x4 = x2;
160 draw_EF;
161 endchar;
162
163 beginchar("F", 4u# + 2s#, asc_height#, 0);
164 "Rustic F";
165 x6 = (x3 + x4) / 2;
166 draw_EF;
167 endchar;
168
169 beginchar("G", 5u# + 2s#, cap_height#, 0);
170 "Rustic G";
171 pickup rustic_pen;
172 rt x1 = w - s; y1 = (crossbar_height + cap_height) / 2;
173 x2 = w / 2; top y2 = h + o;
174 lft x3 = s; y3 = cap_height - crossbar_height;
175 x4 = w / 2; bot y4 = -o;
176 rt x5 = w - s; y5 = cap_height - crossbar_height;
177 draw z1 .. z2 .. z3.. z4 .. z5;
178 labels(range 1 thru 5);
179 endchar;
180
181 beginchar("H", 7u# + 2s#, cap_height#, 0);
182 "Rustic H";
183 pickup rustic_pen;
184 lft x9 = s; y9 = crossbar_height;
185 x1 - x9 = u;
186 draw_I(1, 2, 3, 4)(serif_width);
187 rt x8 = w - s;
188 draw_I(5, 6, 7, 8)(serif_width);
189 draw z9 .. (x5, crossbar_height);
190 labels(range 1 thru 9);
191 endchar;
192
193 beginchar("I", serif_width# + 2s#, cap_height#, 0);
194 "Rustic I";
195 pickup rustic_pen;
196 lft x3 = s;
197 draw_I(1, 2, 3, 4)(serif_width);
198 labels(range 1 thru 4);
199 endchar;
200
201 beginchar("K", 7u# + 2s#, cap_height#, 0);
202 "Rustic K";
203 pickup rustic_pen;
204 lft x3 = s;
205 draw_I(1, 2, 3, 4)(serif_width);
206 x5 = x6 - 2u; top y5 = h + o;
207 rt x6 = w - s; bot y6 = 0;
208 draw (x1 + e, crossbar_height) .. {dir pen_angle}z5;
209 draw (x1 + e, crossbar_height) .. tension 2 .. z6 - (u, 0) .. z6;
210 labels(range 1 thru 6);
211 endchar;
212
213 beginchar("L", 5u# + 2s#, asc_height#, 0);
214 "Rustic L";
215 pickup rustic_pen;
216 lft x3 = s;
217 draw_I(1, 2, 3, 4)(w - 2s);
218 labels(range 1 thru 4);
219 labels(1.l);
220 endchar;
221
222 beginchar("M", 11u# + 2s#, cap_height#, 0);
223 "Rustic M";
224 pickup rustic_pen;
225 top y1 = h + o; bot y2 = -o;
226 x1 = x5 + u;
227 1/2 (z5.l + z5.r) = z5; lft x5 = s + serif_width/2;
228 a := (diag_angle - 90) * 3/4 + 90;
229 draw_diag_stroke(1, 2)(a);
230 top y3 = h + o; bot y4 = 0; rt x4.r = w - s;
231 a := (diag_angle - 90) / 3 + 90;
232 draw_diag_stroke(3, 4)(a);
233
234 % Left stem
235 bot y5 = 0;
236 draw z1 .. z5;
237 draw_serif(5.l, 5.r, serif_width);
238 % Right stem
239 draw z3 .. z2.r;
240
241 labels(range 1 thru 5);
242 endchar;
243
244 beginchar("N", 8u# + 2s#, cap_height#, 0);
245 "Rustic N";
246 pickup rustic_pen;
247
248 % Diagonal stroke
249 x1 + x2 = w; top y1 = h + o; bot y2 = 0;
250 draw_diag_stroke(1, 2)(diag_angle);
251
252 % Left stem
253 bot y3 = 0; lft x3 = s + serif_width/2 - u/3;
254 draw z1 .. z3;
255 1/2 (z3.l + z3.r) = z3;
256 draw_serif(3.l, 3.r, serif_width);
257
258 % Right stem
259 x4 = x5 = x2.r; % vertical stem
260 top y4 = h + o; bot y5 = 0;
261 z4 - z4.l = spur_width * dir spur_angle;
262 draw z4.l .. z4 -- z5;
263
264 labels(range 1 thru 5);
265 endchar;
266
267 beginchar("O", o_width# + 2s#, cap_height#, 0);
268 "Rustic O";
269 pickup rustic_pen;
270 lft x2 = s; rt x4 = w - s; x1 = x3 = w/2;
271 top y1 = h + o; bot y3 = -o; y2 = y4 = crossbar_height;
272 draw z1 .. z2 .. z3 .. z4 .. cycle;
273 labels(range 1 thru 4);
274 endchar;
275
276 beginchar("P", 4u# + 2s#, cap_height#, 0);
277 "Rustic P";
278 pickup rustic_pen;
279 draw_P(1, 2, 3, 4, 5)(w);
280 labels(range 1 thru 5);
281 endchar;
282
283 beginchar("Q", 6u# + 2s#, cap_height#, u#);
284 "Rustic Q";
285 pickup rustic_pen;
286 lft x2 = s; rt x4 = o_width + s; x1 = x3 = (o_width + 2s)/2;
287 top y1 = h + o; bot y3 = -o; y2 = y4 = crossbar_height;
288 rt x5 = w - s; bot y5 = -d;
289 draw z3{curl 3} .. z4 .. z1 .. z2 .. z3 .. {down}z5;
290 labels(range 1 thru 5);
291 endchar;
292
293 beginchar("R", 7u# + 2s#, cap_height#, 0);
294 "Rustic P";
295 pickup rustic_pen;
296 draw_P(1, 2, 3, 4, 5)(5u);
297 rt x6 = w - s; bot y6 = 0;
298 draw (x1 + u, crossbar_height) .. tension 2 .. z6 - (u, 0) .. z6;
299 labels(range 1 thru 6);
300 endchar;
301
302 beginchar("S", 4u# + 2s#, cap_height#, 0);
303 "Rustic S";
304 pickup rustic_pen;
305 lft x2 = s; x2 = x4;
306 rt x1 = w - s; x1 = x3;
307 top y1 = h - 3/2 u; bot y4 = u/2;
308 h - y2 = y3; z2 - z3 = whatever * dir diag_angle;
309 draw z1{curl 2} .. z2 .. z3 .. {curl 1}z4;
310 labels(range 1 thru 4);
311 endchar;
312
313 beginchar("T", 6u# + 2s#, cap_height#, 0);
314 "Rustic T";
315 pickup rustic_pen;
316 x1 = w - x2; top y1 = h;
317 draw_serif(1, 2)(w - 2s);
318 x3 = w - x4; bot y3 = 0;
319 draw_serif(3, 4)(serif_width);
320 draw 1/2 [z1, z2] .. 1/2 [z3, z4];
321 labels(range 1 thru 4);
322 endchar;
323
324 beginchar("V", 6u# + 2s#, cap_height#, 1/2 u#);
325 "Rustic V";
326 pickup rustic_pen;
327 lft x1 = s + spur_width; rt x3 = rt x4 = rt x5 = w - s - u/2;
328 top y1 = h + o; bot y3 = u; top y4 = h + o; bot y5 = -d;
329 bot y2 = 0; lft x2 = 5/2 u + s;
330 draw z1{down} .. z2 .. z3{right};
331 z1 - z1.l = spur_width * dir spur_angle; draw z1.l .. z1; % Spur
332 draw z4{dir -85} .. z5;
333 labels(range 1 thru 5);
334 endchar;
335
336 beginchar("X", 7u# + 2s#, cap_height#, 0);
337 "Rustic X";
338 pickup rustic_pen;
339 top y1 = h + o; bot y2 = 0; rt x2.r = w - s;
340 draw_diag_stroke(1, 2)(diag_angle);
341 draw (x1, y2) .. (x2, y1);
342 labels(range 1 thru 4);
343 endchar;
344
345 beginchar("Y", 8u# + 2s#, cap_height#, 0);
346 "Rustic Y";
347 pickup rustic_pen;
348 x2 = x3 = w/2;
349 lft x1 = s; rt x4 = w - s;
350 bot y3 = 0;
351 top y1 = top y4 = h + o; y2 = crossbar_height;
352 draw z1 .. z2 .. tension 2 .. z3;
353 draw z4{left} .. z2;
354 % Serif
355 1/2 (z3.l + z3.r) = z3;
356 draw_serif(3.l, 3.r, serif_width);
357 labels(range 1 thru 4);
358 endchar;
359
360 beginchar("Z", 6u# + 2s#, cap_height#, 0);
361 "Rustic Z";
362 pickup rustic_pen;
363 lft x1 = s; top y1 = h;
364 draw_serif(1, 2)(w - 2s);
365 lft x3 = s; bot y3 = 0;
366 draw_serif(3, 4)(w - 2s);
367 draw z2 .. z3;
368 labels(range 1 thru 4);
369 endchar;
370
371 ligtable "A": "T" kern -1.5u#, "Y" kern -1.5u#;
372 ligtable "B": "C" kern .5u#, "M" kern -u#;
373 ligtable "F": "A" kern -.5u#, "M" kern -u#, "T" kern -u#;
374 ligtable "G": "C" kern .5u#, "Q" kern .5u#, "G" kern .5u#, "O" kern .5u#;
375 ligtable "K": "C" kern -u#, "G" kern -u#, "T" kern -u#, "Y" kern -u#;
376 ligtable "L": "T" kern -u#, "Y" kern -2u#;
377 ligtable "M": "T" kern -u#;
378 ligtable "O": "M" kern -.5u#;
379 ligtable "P": "A" kern -.5u#, "M" kern -.5u#;
380 ligtable "R": "C" kern -.5u#, "O" kern -u#, "T" kern -u#, "Y" kern -1.5u#;
381 ligtable "T": "A" kern -u#, "H" kern -u#, "M" kern -u#;
382 ligtable "V": "M" kern -u#;
383 ligtable "Y": "M" kern -u#;
384
385 end;
386