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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
|
% -*- Fundamental -*- (emacs-20 mf mode sucks)
% feta-slag.mf -- implement trill symbols
%
% source file of the Feta (definitely not an abbreviation for Font-En-Tja)
% music font
%
% (c) 1998--2009 Jan Nieuwenhuizen <janneke@gnu.org>
%
% this file is included by feta-scripts.mf
trill_thin# = 0.1 staff_space# + 0.6 stafflinethickness#;
trill_stemwidth# = trill_thin#;
define_pixels (trill_thin);
define_whole_blacker_pixels (trill_stemwidth);
trill_thick = 1/2 staff_space;
trill_overlap = 1/6 staff_space;
trill_width# = 5/6 staff_space#;
trill_height# = 1/2 staff_space#;
define_pixels (trill_height);
define_whole_pixels (trill_width);
pair trill_ne;
trill_ne := unitvector ((2, 3));
%
% The trill element sticks out on both the left and right side
% of the normal bbox, so you can glue them together easily.
%
% `ending' is either 0 for none, 1 for left, or 2 for right.
%
def draw_trillelement (expr offset, ending) =
clearxy;
begingroup;
save nw, pat, nw_dist, ne_dist;
pair nw, nw_dist, ne_dist;
path pat;
pickup pencircle scaled trill_thin;
x1 = -.5 trill_width;
y1 = 0;
z3 = whatever * trill_ne + z1;
top y3 = vround trill_height;
z2 = z3 - (trill_thick - trill_thin) * trill_ne;
bot z3' = (top z3) scaled -1;
nw = unitvector (z2 - z3');
ne_dist = (nw rotated -90) * 0.5 trill_thin;
nw_dist = (trill_ne rotated 90) * 0.5 trill_thin;
z5 = whatever * trill_ne + (z1 - nw_dist);
z5 = whatever * nw + (z3' - ne_dist);
pat := z5
-- (z1 - nw_dist){-trill_ne}
-- (z1 + nw_dist){trill_ne}
-- (z3 + nw_dist){trill_ne}
.. top z3{right}
.. (z3 + ne_dist){-nw};
pat := pat
-- pat scaled -1 shifted (-feta_eps, -feta_eps)
-- cycle;
pat := pat shifted (offset, 0);
fill pat;
z4 = z1 - trill_ne * trill_overlap;
x4 := hround (x4 + 0.5 trill_thin) - 0.5 trill_thin;
pat := (z4 - nw_dist){-trill_ne}
.. bot z4{left}
.. lft z4{up}
.. (z4 + nw_dist){trill_ne}
-- (z1 + nw_dist){trill_ne}
-- (z1 - nw_dist){-trill_ne}
-- cycle;
if ending = 1:
fill pat shifted (offset, 0);
elseif ending = 2:
pat := pat scaled -1 shifted (-feta_eps, -feta_eps);
fill pat shifted (offset, 0);
fi;
endgroup;
enddef;
fet_beginchar ("trilelement", "trilelement");
set_char_box (.5 trill_width#, .5 trill_width#,
trill_height#, trill_height#);
draw_trillelement (0, 0);
labels (1, 2, 3, 3', 4, 5, 5');
fet_endchar;
fet_beginchar ("prall", "prall");
set_char_box (trill_width#, trill_width#,
trill_height#, trill_height#);
draw_trillelement (-hround (.5 trill_width), 1);
draw_trillelement (-hround (.5 trill_width) + trill_width, 2);
fet_endchar;
fet_beginchar ("mordent", "mordent");
set_char_box (trill_width#, trill_width#,
4/3 trill_height#, 4/3 trill_height#);
draw_trillelement (-hround (.5 trill_width), 1);
draw_trillelement (-hround (.5 trill_width) + trill_width, 2);
clearxy;
pickup pencircle scaled trill_stemwidth;
top y1 = h;
bot y2 = -d;
x1 = x2;
x2 = 0;
draw_gridline (z2, z1, trill_stemwidth);
labels (1, 2);
fet_endchar;
fet_beginchar ("prallprall", "prallprall");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
trill_height#, trill_height#);
draw_trillelement (-trill_width, 1);
draw_trillelement (0, 0);
draw_trillelement (trill_width, 2);
fet_endchar;
fet_beginchar ("prallmordent", "prallmordent");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
4/3 trill_height#, 4/3 trill_height#);
draw_trillelement (-trill_width, 1);
draw_trillelement (0, 0);
draw_trillelement (trill_width, 2);
clearxy;
pickup pencircle scaled trill_stemwidth;
top y1 = h;
bot y2 = -d;
x1 = x2 ;
x2 = good.x (.5 trill_width);
draw_gridline (z2, z1, trill_stemwidth);
labels (1, 2);
fet_endchar;
save remember_pic;
picture remember_pic;
fet_beginchar ("upprall", "upprall");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
trill_height#, trill_height#);
draw_trillelement (-trill_width, 1);
draw_trillelement (0, 0);
draw_trillelement (trill_width, 2);
z11 = z4 shifted (-trill_width, 0);
z12 = z11 + (0, -2 trill_height);
penpos11 (trill_thin, angle (trill_ne) - 90);
penpos12 (trill_thin, angle (trill_ne yscaled -1) + 90);
penlabels (11, 12);
pickup pencircle scaled trill_stemwidth;
fill z11l{-trill_ne}
.. z12l{trill_ne yscaled -1}
.. bot z12
.. rt z12
.. z12r{-trill_ne yscaled -1}
.. z11r{trill_ne}
-- cycle;
remember_pic := currentpicture;
fet_endchar;
fet_beginchar ("upmordent", "upmordent");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
4/3 trill_height#, 4/3 trill_height#);
currentpicture := remember_pic;
clearxy;
pickup pencircle scaled trill_stemwidth;
top y1 = h;
bot y2 = -d;
x1 = x2;
x2 = good.x (.5 trill_width);
draw_gridline (z2, z1, trill_stemwidth);
labels (1, 2);
fet_endchar;
fet_beginchar ("pralldown", "pralldown");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
trill_height#, trill_height#);
currentpicture := remember_pic xscaled -1;
fet_endchar;
fet_beginchar ("downprall", "downprall");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
trill_height#, trill_height#);
draw_trillelement (-trill_width, 1);
draw_trillelement (0, 0);
draw_trillelement (trill_width, 2);
z11 = z4 shifted (-trill_width, 0);
z12 = z11 + (0, 2 trill_height);
penpos11 (trill_thin, angle (trill_ne xscaled -1) - 90);
penpos12 (trill_thin, angle (trill_ne) - 90);
penlabels (11, 12);
pickup pencircle scaled trill_stemwidth;
fill z11l{trill_ne xscaled -1}
.. z12l{trill_ne}
.. top z12
.. rt z12
.. z12r{-trill_ne}
.. z11r{-trill_ne xscaled -1}
-- cycle;
remember_pic := currentpicture;
fet_endchar;
fet_beginchar ("downmordent", "downmordent");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
4/3 trill_height#, 4/3 trill_height#);
currentpicture := remember_pic;
clearxy;
pickup pencircle scaled trill_stemwidth;
top y1 = h;
bot y2 = -d;
x1 = x2;
x2 = good.x (.5 trill_width);
draw_gridline (z2, z1, trill_stemwidth);
labels (1, 2);
fet_endchar;
fet_beginchar ("prallup", "prallup");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
trill_height#, trill_height#);
currentpicture := remember_pic xscaled -1;
fet_endchar;
fet_beginchar ("lineprall", "lineprall");
set_char_box (1.5 trill_width#, 1.5 trill_width#,
trill_height#, 4 trill_height#);
draw_trillelement (-trill_width, 1);
labels (1, 2, 3, 3', 4, 5, 5');
pickup pencircle scaled trill_stemwidth;
penpos10 (trill_stemwidth, 0);
penpos11 (trill_stemwidth, 0);
x10l = x4 - .5 trill_thin - trill_width;
y10 = y4;
z11 = z10 + (0, h);
penlabels (10, 11);
fill z11l
.. top z11
.. z11r
-- z10r
-- z10l
-- cycle;
draw_trillelement (0, 0);
draw_trillelement (trill_width, 2);
fet_endchar;
|