]> git.donarmstrong.com Git - lilypond.git/blob - mf/feta-banier.mf
release: 0.1.24
[lilypond.git] / mf / feta-banier.mf
1 % flags 
2 %
3
4 fet_begingroup("floogbars")
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)", "3u", "eighthflag")
62
63         save flare, 
64         hip_depth, hip_width,
65         foot_depth, foot_width;
66
67         flare# = 1.0 interline#;
68         hip_depth# = 8/15 foot_depth#; 
69         hip_width# = upflag_width# - hip_thickness#/2;
70
71         foot_depth# =  15/7 interline#;
72         foot_width# = .8 hip_width#;
73
74         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
75                 + stemthickness#/2, 
76                 flare# + foot_depth# + foot_thickness#/2, stemthickness#/2)
77
78         define_pixels(flare, 
79         hip_depth, hip_width, hip_thickness,
80         foot_depth, foot_width, foot_thickness);
81         draw_flag((stemthickness/2,0), flare, 
82                 hip_depth, hip_width, hip_thickness,
83                 foot_depth, foot_width, foot_thickness, 0)
84                 ;       
85         penlabels(1, 2, 3);
86         pickup pencircle scaled stemthickness;
87         draw (0, 0) .. (0,-2 interline);
88 fet_endchar;
89
90 fet_beginchar("8th Flag (down)", "3d", "deighthflag")
91         save flare, 
92         hip_depth, hip_width, 
93         foot_depth, foot_width;
94
95         flare# = 1.0 interline#;
96
97         hip_depth# = 8/15 foot_depth#; 
98         hip_width# = downflag_width# - hip_thickness#/2;
99         foot_depth# = 15/7 interline#;
100         foot_width# = .8 hip_width#;
101
102         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
103                 + stemthickness#/2, 
104                 flare# + foot_depth# + foot_thickness#/2, stemthickness#/2)
105
106         define_pixels(flare, 
107         hip_depth, hip_width, hip_thickness,
108         foot_depth, foot_width, foot_thickness);
109
110         draw_flag((stemthickness/2,0),flare, 
111                 hip_depth, hip_width, hip_thickness,
112                 foot_depth, foot_width, foot_thickness, 0);     
113         pickup pencircle scaled stemthickness;
114         draw (0, 0) .. (0,-2 interline);
115
116         y_mirror_char;
117 fet_endchar;
118
119
120 fet_beginchar("16th Flag (up)", "4u", "sixteenthflag")
121         save flare,  flagspace,
122         hip_depth, hip_width, 
123         foot_depth, foot_width;
124
125         flare# = 0.85 interline#;
126         flagspace# = .85 interline#;
127         hip_depth# = 8/15 foot_depth#; 
128
129         flagspace# + flare# + foot_depth# = 3.25 interline#;
130
131         hip_width# = upflag_width# - hip_thickness#/2;
132         foot_width# = .8 hip_width#;
133
134         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
135                 + stemthickness#/2, 
136                 3.25 interline#, stemthickness#/2)
137
138         define_pixels(flagspace);
139                 define_pixels(flare, 
140         hip_depth, hip_width, hip_thickness,
141         foot_depth, foot_width, foot_thickness);
142
143         draw_flag((stemthickness/2, 0),flare, 
144                 1.2 hip_depth, .97 hip_width, hip_thickness,
145                 foot_depth, .9 foot_width, foot_thickness, 0.37);       
146         draw_flag((stemthickness/2, -flagspace),flare, 
147                 hip_depth,  hip_width, hip_thickness,
148                 foot_depth, foot_width, foot_thickness, 0);     
149
150         pickup pencircle scaled stemthickness;
151         draw (0, 0) .. (0,-2 interline);
152
153 fet_endchar;
154
155
156 fet_beginchar("16th Flag (up)", "4d", "dsixteenthflag")
157         save flare,  flagspace,
158         hip_depth, hip_width, 
159         foot_depth, foot_width;
160
161         flare# = 0.87 interline#;
162         flagspace# = .9 interline#;
163         hip_depth# = .7 foot_depth#; 
164
165         flagspace# + flare# + foot_depth# = 3 interline#;
166
167         hip_width# = downflag_width# - hip_thickness#/2;
168
169         foot_width# = 1.00 hip_width#;
170
171         set_char_box(stemthickness# /2, hip_width#  + hip_thickness#/2 
172                 + stemthickness#/2, 
173                 3 interline#, stemthickness#/2)
174
175         define_pixels(flagspace);
176                 define_pixels(flare, 
177         hip_depth, hip_width, hip_thickness,
178         foot_depth, foot_width, foot_thickness);
179
180         draw_flag((stemthickness/2, 0),flare, 
181                  hip_depth, .97 hip_width, hip_thickness,
182                 1.2 foot_depth, .95 foot_width, foot_thickness, 0.0);   
183
184         draw_flag((stemthickness/2, -flagspace),flare, 
185                 hip_depth,  hip_width, hip_thickness,
186                 foot_depth, foot_width, foot_thickness, 0);     
187
188         pickup pencircle scaled stemthickness;
189         draw (0, 0) .. (0,-2 interline);
190
191         y_mirror_char;
192 fet_endchar;
193
194 fet_endgroup("floogbars");