]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-banier.mf
release: 0.1.25
[lilypond.git] / mf / feta-banier.mf
1 % flags 
2 %
3
4 fet_begingroup("flags")
5
6 % Flags pointing down overlap with  the notehead (in x-direction), so 
7 % the down-flag can be bigger
8 upflag_width# = .750 black_notehead_width#;
9 downflag_width# = .833 black_notehead_width#;
10
11 %
12 % Flags pointing down cannot overlap with the notehead in y-direction,
13 % so they have less slant.
14
15 %
16 % Because of optical illusion, the utmost flag 
17 % (bottom for down-pointing, top  
18 % for up-pointing) should be smaller than the other flags 
19 %
20
21 save hip_thickness, foot_thickness;
22 hip_thickness# = 1.3 stemthickness#;
23 foot_thickness# =  hip_thickness#;
24
25 %
26 % Inspired by Adobe Sonata and [Wanske]
27 % for example, see POSTSCRIPT Language -- program design, 
28 % page 119, and [Wanske], p 41,42
29 %
30 def draw_flag(expr center, flare,
31         hip_depth, hip_width, hip_thickness,
32         foot_depth, foot_width, foot_thickness, flagcut) =
33         clearxy;
34
35         penpos1(flare, 90);
36         penpos2(whatever, 40);
37         x2r - x2l = hip_thickness;
38         penpos3(foot_thickness, 0) ;
39
40         z1r  = center;
41         z2 = center + (hip_width, -flare - hip_depth);
42         z3orig = center + (foot_width, -flare - foot_depth);
43         z3 = (1-flagcut) [z2, z3orig];
44
45
46         save bot_dir, bot_path;
47         pair bot_dir;
48         path bot_path;
49         bot_path := z2{down} .. z3;
50         bot_dir := direction 1 of bot_path;
51
52         fill z1l{curl 0}
53                 ..tension 1.1 .. z2l .. 
54                 z3l{bot_dir}  .. z3r{-bot_dir} ..
55                 z2r .. {up}z1r & z1r -- cycle;
56 enddef;
57
58
59
60 % godbewaarme, wat een kutsymbolen
61 fet_beginchar("8th Flag (up)", "u3", "eighthflag")
62         save flare, 
63         hip_depth, hip_width,
64         foot_depth, foot_width;
65
66         flare# = 1.0 interline#;
67         hip_depth# = 8/15 foot_depth#; 
68         hip_width# = upflag_width# - hip_thickness#/2;
69
70         foot_depth# + flare# =  3 interline#;
71         foot_width# = .8 hip_width#;
72
73         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
74                 + stemthickness#/2, 
75                 flare# + foot_depth# + foot_thickness#/2, stemthickness#/2)
76
77         define_pixels(flare, 
78         hip_depth, hip_width, hip_thickness,
79         foot_depth, foot_width, foot_thickness);
80         draw_flag((stemthickness/2,0), flare, 
81                 hip_depth, hip_width, hip_thickness,
82                 foot_depth, foot_width, foot_thickness, 0)
83                 ;       
84         penlabels(1, 2, 3);
85         pickup pencircle scaled stemthickness;
86         draw (0, 0) .. (0,-2 interline);
87 fet_endchar;
88
89 fet_beginchar("8th Flag (down)", "d3", "deighthflag")
90         save flare, 
91         hip_depth, hip_width, 
92         foot_depth, foot_width;
93
94         flare# = 1.0 interline#;
95
96         hip_depth# = 8/15 foot_depth#; 
97         hip_width# = downflag_width# - hip_thickness#/2;
98
99         % 2.9 -> don't intersect staffline at foot
100         foot_depth# + flare# =  2.85 interline#;
101         foot_width# = .82 hip_width#;
102
103         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
104                 + stemthickness#/2, 
105                 flare# + foot_depth# + foot_thickness#/2, stemthickness#/2)
106
107         define_pixels(flare, 
108         hip_depth, hip_width, hip_thickness,
109         foot_depth, foot_width, foot_thickness);
110
111         draw_flag((stemthickness/2,0),flare, 
112                 hip_depth, hip_width, hip_thickness,
113                 foot_depth, foot_width, foot_thickness, 0);     
114         pickup pencircle scaled stemthickness;
115         draw (0, 0) .. (0,-2 interline);
116
117         y_mirror_char;
118 fet_endchar;
119
120
121 fet_beginchar("16th Flag (up)", "u4", "sixteenthflag")
122         save flare,  flagspace,
123         hip_depth, hip_width, 
124         foot_depth, foot_width;
125
126         flare# = 0.85 interline#;
127         flagspace# = .85 interline#;
128         hip_depth# = 8/15 foot_depth#; 
129
130         flagspace# + flare# + foot_depth# = 3.5 interline#;
131
132         hip_width# = upflag_width# - hip_thickness#/2;
133         foot_width# = .8 hip_width#;
134
135         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
136                 + stemthickness#/2, 
137                 3.5 interline#, stemthickness#/2)
138
139         define_pixels(flagspace);
140                 define_pixels(flare, 
141         hip_depth, hip_width, hip_thickness,
142         foot_depth, foot_width, foot_thickness);
143
144         draw_flag((stemthickness/2, 0),flare, 
145                 1.2 hip_depth, .97 hip_width, hip_thickness,
146                 foot_depth, .9 foot_width, foot_thickness, 0.5);        
147         draw_flag((stemthickness/2, -flagspace),flare, 
148                 hip_depth,  hip_width, hip_thickness,
149                 foot_depth, foot_width, foot_thickness, 0);     
150
151         pickup pencircle scaled stemthickness;
152         draw (0, 0) .. (0,-2 interline);
153
154 fet_endchar;
155
156
157 fet_beginchar("16th Flag (down)", "d4", "dsixteenthflag")
158         save flare,  flagspace,
159         hip_depth, hip_width, 
160         foot_depth, foot_width;
161
162         flare# = 0.87 interline#;
163         flagspace# = .9 interline#;
164         hip_depth# = .7 foot_depth#; 
165
166         flagspace# + flare# + foot_depth# = 3 interline#;
167
168         hip_width# = downflag_width# - hip_thickness#/2;
169
170         foot_width# = 1.00 hip_width#;
171
172         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
173                 + stemthickness#/2, 
174                 3 interline#, stemthickness#/2)
175
176         define_pixels(flagspace);
177                 define_pixels(flare, 
178         hip_depth, hip_width, hip_thickness,
179         foot_depth, foot_width, foot_thickness);
180
181         draw_flag((stemthickness/2, 0),flare, 
182                  hip_depth, .97 hip_width, hip_thickness,
183                 1.2 foot_depth, .95 foot_width, foot_thickness, 0.0);
184
185         draw_flag((stemthickness/2, -flagspace),flare, 
186                 hip_depth,  hip_width, hip_thickness,
187                 foot_depth, foot_width, foot_thickness, 0);     
188
189         pickup pencircle scaled stemthickness;
190         draw (0, 0) .. (0,-2 interline);
191
192         y_mirror_char;
193 fet_endchar;
194
195 fet_beginchar("32nd Flag (up)", "u5", "thirtysecondflag")
196         save flare,  flagspace,
197         hip_depth, hip_width, 
198         foot_depth, foot_width;
199
200         flare# = 0.85 interline#;
201         flagspace# = .87 interline#;
202         hip_depth# = 8/15 foot_depth#; 
203
204         2 flagspace# + flare# + foot_depth# = 4.25 interline#;
205
206         hip_width# = upflag_width# - hip_thickness#/2;
207         foot_width# = .8 hip_width#;
208
209         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
210                 + stemthickness#/2, 
211                 4.25 interline#, stemthickness#/2)
212
213         define_pixels(flagspace);
214                 define_pixels(flare, 
215         hip_depth, hip_width, hip_thickness,
216         foot_depth, foot_width, foot_thickness);
217
218         draw_flag((stemthickness/2, 0),flare, 
219                 1.25 hip_depth, .95 hip_width, hip_thickness,
220                 .85 foot_depth, 1.1 foot_width, foot_thickness, 0.0);   
221         draw_flag((stemthickness/2, -flagspace),flare, 
222                 1.2 hip_depth, .97 hip_width, hip_thickness,
223                 foot_depth, .9 foot_width, foot_thickness, 0.37);       
224         draw_flag((stemthickness/2, -2 flagspace),flare, 
225                 1.1 hip_depth,  hip_width,  hip_thickness,
226                 foot_depth, 1.15 foot_width,  foot_thickness, 0);       
227
228         pickup pencircle scaled stemthickness;
229         draw (0, 0) .. (0,-3 interline);
230
231 fet_endchar;
232
233
234
235 fet_beginchar("32nd Flag (up)", "d5", "dthirtysecondflag")
236         save flare,  flagspace,
237         hip_depth, hip_width, 
238         foot_depth, foot_width;
239
240         flare# = 0.85 interline#;
241         flagspace# = .85 interline#;
242         hip_depth# = .57 foot_depth#; 
243         foot_width# = 1.0 hip_width#;
244
245         2 flagspace# + flare# + foot_depth# = 3.85 interline#;
246         hip_width# = upflag_width# - hip_thickness#/2;
247
248
249         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
250                 + stemthickness#/2, 
251                 3.85 interline#, stemthickness#/2)
252
253         define_pixels(flagspace);
254                 define_pixels(flare, 
255         hip_depth, hip_width, hip_thickness,
256         foot_depth, foot_width, foot_thickness);
257
258         draw_flag((stemthickness/2, 0),flare, 
259                 1.3 hip_depth, .93 hip_width, hip_thickness,
260                 foot_depth,  .9 foot_width, foot_thickness, 0.0);       
261         draw_flag((stemthickness/2, -flagspace),flare, 
262                 1.15 hip_depth, .97 hip_width, hip_thickness,
263                 foot_depth,  .95 foot_width, foot_thickness, 0.0);      
264         draw_flag((stemthickness/2, -2 flagspace),flare, 
265                 1.0 hip_depth,  hip_width, .95 hip_thickness,
266                 foot_depth,  foot_width, .93 foot_thickness, 0);        
267
268         pickup pencircle scaled stemthickness;
269         draw (0, 0) .. (0,-3 interline);
270         y_mirror_char;
271 fet_endchar;
272
273 fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag")
274         save flare,  flagspace,
275         hip_depth, hip_width, 
276         foot_depth, foot_width;
277
278         flare# = 0.85 interline#;
279         flagspace# = .9 interline#;
280         hip_depth# = 8/15 foot_depth#; 
281
282         3 flagspace# + flare# + foot_depth# = 5.25 interline#;
283
284         hip_width# = upflag_width# - hip_thickness#/2;
285         foot_width# = .8 hip_width#;
286
287         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
288                 + stemthickness#/2, 
289                 5.25 interline#, stemthickness#/2)
290
291         define_pixels(flagspace);
292                 define_pixels(flare, 
293         hip_depth, hip_width, hip_thickness,
294         foot_depth, foot_width, foot_thickness);
295
296         draw_flag((stemthickness/2, 0),flare, 
297                 1.25 hip_depth, .95 hip_width, hip_thickness,
298                 .85 foot_depth, 1.1 foot_width, foot_thickness, 0.0);   
299         draw_flag((stemthickness/2, -flagspace),flare, 
300                 1.2 hip_depth, .97 hip_width, hip_thickness,
301                 foot_depth, .9 foot_width, foot_thickness, 0.37);       
302         draw_flag((stemthickness/2, -2flagspace),flare, 
303                 1.2 hip_depth, .97 hip_width, hip_thickness,
304                 foot_depth, .9 foot_width, foot_thickness, 0.37);       
305         draw_flag((stemthickness/2, -3 flagspace),flare, 
306                 1.1 hip_depth,  hip_width,  hip_thickness,
307                 foot_depth, 1.15 foot_width,  foot_thickness, 0);       
308
309         pickup pencircle scaled stemthickness;
310         draw (0, 0) .. (0,-5 interline);
311
312 fet_endchar;
313
314
315 fet_beginchar("64th Flag (down)", "d6", "dsixtyfourthflag")
316         save flare,  flagspace,
317         hip_depth, hip_width, 
318         foot_depth, foot_width;
319         save lastcut;
320         flare# = 0.85 interline#;
321         flagspace# = .9 interline#;
322         hip_depth# = .57 foot_depth#; 
323         foot_width# = 1.0 hip_width#;
324
325         lastcut = .7;
326
327         3 flagspace# + flare# + hip_depth# + 
328                 (foot_depth# - hip_depth#) * (1-lastcut) = 4.35 interline#;
329         hip_width# = upflag_width# - hip_thickness#/2;
330
331
332         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
333                 + stemthickness#/2, 
334                 4.35 interline#, stemthickness#/2)
335
336         define_pixels(flagspace);
337                 define_pixels(flare, 
338         hip_depth, hip_width, hip_thickness,
339         foot_depth, foot_width, foot_thickness);
340
341         draw_flag((stemthickness/2, 0),flare, 
342                 1.33 hip_depth, .92 hip_width, hip_thickness,
343                 1.15 foot_depth,  .9 foot_width, foot_thickness, 0.0);  
344         draw_flag((stemthickness/2, -flagspace),flare, 
345                 1.15 hip_depth, .97 hip_width, hip_thickness,
346                 1.14 foot_depth,  .92 foot_width, foot_thickness, 0.0); 
347         draw_flag((stemthickness/2, -2 flagspace),flare, 
348                 1.15 hip_depth, .97 hip_width, hip_thickness,
349                 1.12 foot_depth,  .95 foot_width, foot_thickness, 0.0); 
350         draw_flag((stemthickness/2, -3flagspace),flare, 
351                 1.0 hip_depth,  hip_width, .95 hip_thickness,
352                 foot_depth,  foot_width, .93 foot_thickness, lastcut);  
353
354         pickup pencircle scaled stemthickness;
355         draw (0, 0) .. (0,-5 interline);
356         y_mirror_char;
357 fet_endchar;
358
359
360 fet_endgroup("flags");