-
Notifications
You must be signed in to change notification settings - Fork 0
/
k.mf
166 lines (115 loc) · 3.47 KB
/
k.mf
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
%% k.mf
%% * (1) Copyright and License.
%%%% This file is part of the source code for Mariu, a calligraphic font, programmed in METAFONT.
%%%% Copyright (C) 2022 Laurence D. Finston
%%%% Mariu is free software; you can redistribute it and/or modify
%%%% it under the terms of the GNU General Public License as published by
%%%% the Free Software Foundation; either version 3 of the License, or
%%%% (at your option) any later version.
%%%% Mariu is distributed in the hope that it will be useful,
%%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
%%%% GNU General Public License for more details.
%%%% You should have received a copy of the GNU General Public License
%%%% along with Mariu; if not, write to the Free Software
%%%% Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
%%%% Please send bug reports to [email protected]
%%%% The author can be contacted at:
%%%% Laurence D. Finston
%%%% [email protected]
%% This is k.mf
%% Revised Oct 28, 1996.
%special "grayfont black";
do_fill:=true;
%do_fill:=false;
beginchar("k",6.6pt#,9.125pt#,0pt#); "The letter k";
clear_vars;
scaling_factor = 47/40;
nom_w = scaling_factor*5.1pt;
nom_h = scaling_factor*7.4pt;
% This does the downstroke.
pickup my_fill_pen;
pos0(nib,15);pos1(nib,15);pos2(nib,15);
top rt z0r = (25/64 nom_w, nom_h);
z1 = (15/64 nom_w,1/8 nom_h);
lft x2l = 11/64 nom_w;
bot y2l = -1/64 nom_h;
z3 = (dir 15 * whatever) shifted z2;
x3 = x2 + 3/64 nom_w;
convert_path.p0 (z0e{down}..{down}z1e..z2e);
if do_fill=true:
my_pen(15);
draw p0.m;
draw z2..z3;
fi;
% This does the forestroke.
pickup my_fill_pen;
begingroup save a,b,c;
a = 47.5;
pos4(nib,a);pos5(nib,a);
lft z4l = (0,55/64 nom_h);
z5 = (dir (a-90) * whatever) shifted z4;
x5 = 1/4 nom_w;
if do_fill=true:
my_pen(a); draw z4..z5;
fi;
endgroup;
%% This does the upper leg
begingroup save a,b,c;
b = 50;
pos6(nib,45);pos7(nib,45);pos8(nib,b);
lft z6l = (10/64 nom_w, 21/64 nom_h);
z7 = (51/64 nom_w, 75/128 nom_h);
bot lft z8l = (5/8 nom_w, 23/64 nom_h);
a = 1.7;
convert_path.p1 (z6e..tension a..z7e{dir -30}..%
{dir (b+180)}z8e);
if do_fill=true:
around_crossing_pt(p1,0,1.59,x_pt_factor);
%% This draws the end of the stroke at z8.
pickup my_fill_pen; draw p1;
z13 = (dir (b+180) * whatever) shifted z8;
y13 = 13/32 nom_h;
my_pen(b); drawdot z13;
around_crossing_pt(p1,0,1.59,x_pt_factor);
pickup my_fill_pen; draw p1;
fi;
endgroup;
%% This does the lower leg.
pickup my_fill_pen;
pos9(nib,40);pos10(nib,40);pos11(nib,40);
pos12(nib,45);
z9 = (x6, 18/64 nom_h);
z10 = (84/128 nom_w, 18/64 nom_h);
bot lft z11l = (103/128 nom_w, 0/128 nom_h);
z12 = (dir 40 * whatever) shifted z11;
rt x12r = nom_w;
begingroup save a,b,c;
b = 1.2;
convert_path.p2 (z9e..tension b..z10e..tension b..%
z11e..{dir 45}z12e);
endgroup;
%% I'm not satisfied with the way the end looks.
%% The reason is that a few pixels are blackened by
%% my_pen(40) at z11, but it looks bad if I get rid of
%% it with undrawdot. I think the best solution is to
%% get rid of the extra pixels at the end of the outstroke
%% with the bit-map editor.
if do_fill=true:
pickup my_fill_pen;
my_pen(40); draw subpath(0,2) of p2.m;
my_pen(45);
draw z11--z12;
fi;
%do_letter_shift := false;
if do_letter_shift = true:
do_rules := false;
letter_shift (v0,.3pt,0);
else:
penlabels(range 0 thru 13);
input nom_rules;
fi;
endchar;
% Local Variables:
% auto-save-interval:0
% End: