-
Notifications
You must be signed in to change notification settings - Fork 0
/
m.mf
209 lines (142 loc) · 4.2 KB
/
m.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
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
%% m.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 m.mf
%% Based on drawing 1.
%% Revised Nov. 1, 1996.
do_fill:=true;
%do_fill:=false;
%special "grayfont black";
beginchar("m",6.85pt#,6.9pt#,.45pt#); "The letter m";
clear_vars;
begingroup
save a,b,c;
scaling_factor = 25/20;
nom_w = scaling_factor*5pt;
nom_h = scaling_factor*5.2pt;
% This does the leftmost downstroke.
begingroup save a,b,c,f;
a = 45;
b = 1.2;
pickup my_fill_pen;
pos0(nib,40);pos1(nib,40);pos2(nib,40);pos3(nib,a);pos4(nib,40);
top rt z0r = (37/128 nom_w, nom_h);
top rt z1r = (32/128 nom_w, 3/4 nom_h);
bot lft z2l = (7/128 nom_w, 0);
bot lft z3l = (14/128 nom_w, -2/64 nom_h);
z4 = (dir a * whatever) shifted z3;
x4 = x3 + 1/32 nom_w;
convert_path.p0 (z0e..tension b..z1e{z2-z1}..%
tension b..{z2-z1}z2e..tension 1.2..%
z3e);
c = .049;
%% This is for fixing the end of the outstroke, which was too low.
z3a = (dir (a+90) * whatever) shifted z3;
z4a = (dir (a+90) * whatever) shifted z4;
f = .25nib_thickness;
f*f+y3-x3 = y3a-x3a;
z4a-z4 = z3a-z3;
if do_fill=true:
filldraw subpath(0,3-c) of p0.l -- %
reverse subpath(0,3-c) of p0.r -- cycle;
my_pen(a); draw z3a{z3l-z2l}..{z4-z3}z4a;
fi;
endgroup;
%% This draws the forestroke.
begingroup save a,b,c;
a = 50;
pickup my_fill_pen;
pos5(nib,a);pos6(nib,a);
lft z5l = (0, 52/64 nom_h);
z6 = (dir (a-105) * whatever) shifted z5;
rt x6r = 33/128 nom_w;
if do_fill=true:
my_pen(a);
draw z5..z6;
fi;
endgroup;
%% This draws the middle downstroke.
pickup my_fill_pen;
pos7(nib,45);pos8(nib,45);pos9(nib,45);pos10(nib,45);
pos11(nib,45);
rt top z8r = (57/128 nom_w, 51/64 nom_h);
z7 = (dir 40 * whatever) shifted z8;
x7l = 6/32 nom_w;
lft bot z9l = (26/64 nom_w, 0/64 nom_h);
z10 = (dir (45-90) * whatever) shifted z9;
y10 = y9 - 2/64 nom_h;
z11a = (dir 45 * whatever) shifted z10;
x11a = x10 + 1/32 nom_w;
z11 = z11a shifted (0,-1/64 nom_h);
z12 = (dir 45 * whatever) shifted z11;
x12 = x11 + 1/64 nom_w;
begingroup save a,b,c;
a = 1;
b = 1.4;
c = .4;
convert_path.p1 (z7e{dir 40}..tension a..%
{dir 40}z8e..tension b..%
{dir -100}z9e..z10e..z11e);
if do_fill=true:
filldraw subpath(0,4-c) of p1.l -- %
reverse subpath(0,4-c) of p1.r -- cycle;
my_pen(45);
draw z11..z12;
fi;
endgroup;
%% This draws the rightmost downstroke
pickup my_fill_pen;
pos13(nib,45);pos14(nib,45);pos15(nib,50);pos16(nib,50);
pos17(nib,50);
lft z13l = (30/64 nom_w, 36/64 nom_h);
rt top z14r = (53/64 nom_w, 54/64 nom_h);
lft bot z15l = (101/128 nom_w, 0);
z16 = (dir (45-90) * whatever) shifted z15;
bot lft y16l = -3/64 nom_h;
z17 = (dir 50 * whatever) shifted z16;
rt x17r = nom_w;
begingroup save a,b,c;
a = 1.2;
b = 1.4;
convert_path.p2 (z13e..tension a..z14e..tension b..z15e..z16e);
if do_fill=true:
%% I think this is alright
pickup pensquare xscaled 1.09nib yscaled nib_thickness rotated 45;
draw subpath(0,1) of p2.m;
pickup my_fill_pen;
filldraw subpath(1,3) of p2.l -- reverse subpath(1,3) of p2.r -- %
cycle;
my_pen(50);
draw z16..z17;
fi;
endgroup;
%do_letter_shift := false;
if do_letter_shift = true:
do_rules := false;
letter_shift (v0,.32pt,0);
else:
penlabels(range 0 thru 17, 3a, 4a);
input nom_rules;
fi
endgroup;
endchar;
% Local Variables:
% mf-gf:mfc-gfc
% auto-save-interval:0
% End: