-
Notifications
You must be signed in to change notification settings - Fork 0
/
N.mf
179 lines (106 loc) · 3.36 KB
/
N.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
%% N.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 N.mf
%%%% Based on drawing at top left.
special "grayfont black";
beginchar("N",7.5pt#,8.5pt#,4pt#); "The letter ";
clear_vars;
scaling_factor = 20/20;
nom_w = scaling_factor*6.4pt;
nom_h = scaling_factor*7.8pt;
nom_d = scaling_factor*3.2pt;
%do_fill=true;
do_fill=false;
%% This does the curved stroke on the left.
pickup my_fill_pen;
pos0(nib,35);pos3(nib,35);pos6(nib,35);pos9(nib,35);
bot lft z0l = (0, 13/16 nom_h);
top rt z3r = (32/64 nom_w, 63/64 nom_h);
bot lft z6l = (14/64 nom_w, 1/128 nom_w);
rt z9r = (47/64 nom_w, 13/64 nom_h);
convert_path.p0(z0e..tension 1.25..z3e..tension 1.1..z6e..tension 1.2..z9e);
if do_fill=true:
my_pen(35);
draw p0.m;
else
draw p0;
fi;
pickup my_fill_pen;
%%%% This does the vertical stroke with the tail on the right.
pos10(nib,40);
pos12(nib,40);pos15(nib,40);pos18(nib,40);
top rt z10r = (nom_w, 129/128 nom_h);
top rt z12r = (56/64 nom_w, 56/64 nom_h);
z15 = (45/64 nom_w, 16/64 nom_h);
top rt z18r = (91/128 nom_w, -15/64 nom_d);
%% Change this so the right "serif" is part of the stroke.
convert_path.p1(z10e..z12e..z15e..z18e & z18e);
if do_fill=true:
filldraw p1;
else: draw p1;
fi;
%% This makes a hairstroke, no matter where z18 and z21 are in relation to
%% one another. "a" should not deviate too much from 40 (or whatever the angle
%% of the nib is at z18 and z21), otherwise it will look bad.
pos21(nib,40);
bot lft z21l = (20/64 nom_w, -127/128 nom_d);
begingroup save a,b,c;
a = angle (z21-z18);
if do_fill=true:
my_pen(a);
draw z18--z21;
else:
pickup my_fill_pen;
draw z18l--z18r--z21r--z21l--cycle;
fi;
endgroup;
%% This does the serif at the bottom
pickup my_fill_pen;
begingroup save a,b,c;
a = 6/8;
pos22(a*nib, 40);
pos24(a*nib,40);
endgroup;
bot lft z22l = bot lft z21l;
bot lft z24l = (10/64 nom_w, -126/128 nom_d);
convert_path.p2(z22e{dir 210}..{dir 210}z24e);
if do_fill=true:
filldraw p2;
else:
draw p2
fi;
%% This does the serif at the left of the vertical stroke
%%z27,z28.
%% This does the crossbar.
do_letter_shift := false;
if do_letter_shift = true:
do_rules := false;
letter_shift (v0,0pt,0pt);
else:
penlabels(range 0 thru 30);
input nom_rules;
%input nom_rules_extra;
fi;
endchar;
%% This was in the local variables list. I seem not to need it, though.
% mf-gf:"callig"
% Local Variables:
% auto-save-interval:0
% End: