lilypond-1.5.10
[lilypond.git] / mf / feta-slag.mf
blobdf3ae8d0cb9665b140c90652740f5d21a1af0714
1 % -*- Fundamental -*-  (emacs-20 mf mode mucks
2 % feta-slag.mf --  implement trill symbols
3
4 % source file of the Feta (defintively not an abbreviation for Font-En-Tja)
5 % music font
6
7 % (c) 1998--2001 Jan Nieuwenhuizen <janneke@gnu.org>
8
10 % this file is included by feta-scripts.mf
12 tfat := 1/2;
13 %twidth# := 0.5staff_space#;
14 %theight# := 0.55staff_space#;
15 % tthin# := stafflinethickness#;
16 tthin# := 1.6stafflinethickness#;
18 twidth# := 2/3staff_space#;
19 theight# := 1/2staff_space#;
21 % uhg/ uhuh?
22 % toverlap# := tfat*twidth#+tthin#;
23 toverlap# := tfat*twidth#+0.45tthin#;
24 define_pixels(twidth,theight,tthin,toverlap);
26 def draw_trillelement = 
27         save x, y;
29         pickup pencircle scaled tthin;
30         
31         lft x1 = -twidth;
32 %       x3 = -1/3*twidth;
33         x3 = -0.3*twidth;
34         top y3 = theight;
36         z3 - z1 = whatever * (0.5twidth, theight);
37         z2 = tfat[z3, z1];
39         path p;
40         p = z3 -- z2 -- z1 -- z2;
41         p := p -- (p scaled -1) -- cycle;
42         filldraw p;
43         labels(1,2,3);
44 enddef;
46 def draw_trill_two = 
47         draw_trillelement;
48         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
49         draw_trillelement;
50         currentpicture := currentpicture shifted (twidth-0.5toverlap, 0);
51 enddef;
53 def draw_trill_three = 
54         draw_trillelement;
55         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
56         draw_trillelement;
57         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
58         draw_trillelement;
59         currentpicture := currentpicture shifted (2twidth-toverlap, 0);
60 enddef;
62 def draw_trill_four = 
63         draw_trillelement;
64         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
65         draw_trillelement;
66         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
67         draw_trillelement;
68         currentpicture := currentpicture shifted (-2*twidth+toverlap, 0);
69         draw_trillelement;
70         currentpicture := currentpicture shifted (3twidth-1.5toverlap, 0);
71 enddef;
73 def draw_mordent(expr a) = 
74         pickup pencircle scaled tthin;
75         save x, y;
76         top y1 = 4/3theight;
77         x1 = x2 = a;
78         y2 = - y1;
79         draw z1 -- z2;
80 enddef;
82 fet_beginchar("trilelement", "trilelement", "trilelement")
83 %       set_char_box(twidth#, twidth#, theight#, theight#);
84         set_char_box(twidth#, twidth#-toverlap#, theight#, theight#);
85         draw_trillelement;
86 fet_endchar;
88 fet_beginchar("prall", "prall", "prall")
89         trills := 2;
90         set_char_box(trills*twidth#-0.5toverlap#, trills*twidth#-0.5toverlap#, theight#, theight#);
91         draw_trill_two;
92 fet_endchar;
94 fet_beginchar("mordent", "mordent", "mordent")
95         trills := 2;
96         set_char_box(trills*twidth#-0.5toverlap#, trills*twidth#-0.5toverlap#, 4/3*theight#, 4/3*theight#);
97         draw_trill_two;
98         draw_mordent(0);
99 fet_endchar;
102 % in modern typesetting, i've seen these double symbols implemented 
103 % as three trills rather than the actual double four [gerou and lusk].
104 % it looks nicer and i don't think it introduces ambiguity.
105 % would like to have more references -- jcn.
107 fet_beginchar("prallprall", "prallprall", "prallprall")
108         trills := 3;
109         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
110         draw_trill_three;
111 fet_endchar;
113 fet_beginchar("prallmordent", "prallmordent", "prallmordent")
114         trills := 3;
115         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, 4/3*theight#, 4/3*theight#);
116         draw_trill_three;
117         draw_mordent(twidth-0.5toverlap);
118 fet_endchar;
120 input feta-sleur;
123 % URG.   The attached slurs look weird, and discontinuous in their connection to the 
124 % main part.  --hwn
126 fet_beginchar("upprall", "upprall", "upprall")
127 %       trills := 4;
128         trills := 3;
129         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
130 %       draw_slur(-2twidth#,-2theight#,0,-1);
131 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
132         draw_slur(0,-2theight#,0,-1);
133 %       currentpicture := currentpicture shifted (-0.5w+1.3tthin,-tfat*theight+1.5tthin);
134         currentpicture := currentpicture shifted (-0.5w+1.65tthin,-tfat*theight+1.15tthin);
135 %       draw_trill_four;
136         draw_trill_three;
137 fet_endchar;
139 fet_beginchar("downprall", "downprall", "downprall")
140         trills := 3;
141         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
142 %       draw_slur(-2twidth#,2theight#,0,1);
143         draw_slur(0,2theight#,0,1);
144 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
145         currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.5tthin);
146         draw_trill_three;
147 fet_endchar;
149 fet_beginchar("upmordent", "upmordent", "upmordent")
150 %       trills := 4;
151         trills := 3;
152         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, 4/3*theight#, 4/3*theight#);
153 %       draw_slur(-2twidth#,-2theight#,0,-1);
154 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
155         draw_slur(0,-2theight#,0,-1);
156 %       currentpicture := currentpicture shifted (-0.5w+1.3tthin,-tfat*theight+1.5tthin);
157         currentpicture := currentpicture shifted (-0.5w+1.65tthin,-tfat*theight+1.15tthin);
158 %       draw_trill_four;
159         draw_trill_three;
160         draw_mordent(twidth-0.5toverlap);
161 fet_endchar;
163 fet_beginchar("downmordent", "downmordent", "downmordent")
164         trills := 3;
165         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, 4/3*theight#, 4/3*theight#);
166 %       draw_slur(-2twidth#,2theight#,0,1);
167         draw_slur(0,2theight#,0,1);
168 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
169         currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.5tthin);
170         draw_trill_three;
171         draw_mordent(twidth-0.5toverlap);
172 fet_endchar;
174 fet_beginchar("lineprall", "lineprall", "lineprall")
175         trills := 3;
176         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, 4*theight#);
177         pickup pencircle scaled tthin;
178         draw (-0.5w+tthin,-tfat*theight+0.5tthin) -- (-0.5w+tthin,h);
179         draw_trill_three;
180 fet_endchar;
182 fet_beginchar("pralldown", "pralldown", "pralldown")
183 %       trills := 4;
184         trills := 3;
185         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
186 %       draw_slur(-2twidth#,-2theight#,0,-1);
187 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
188         draw_slur(0,-2theight#,0,-1);
189 %       currentpicture := currentpicture shifted (-0.5w+1.3tthin,-tfat*theight+1.5tthin);
190         currentpicture := currentpicture shifted (-0.5w+1.65tthin,-tfat*theight+1.15tthin);
191 %       draw_trill_four;
192         draw_trill_three;
193         currentpicture := currentpicture xscaled -1;
194 fet_endchar;
196 fet_beginchar("prallup", "prallup", "prallup")
197         trills := 3;
198         set_char_box(trills*twidth#-(trills-1)*0.5toverlap#, trills*twidth#-(trills-1)*0.5toverlap#, theight#, theight#);
199 %       draw_slur(-2twidth#,2theight#,0,1);
200         draw_slur(0,2theight#,0,1);
201 %       currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.75tthin);
202         currentpicture := currentpicture shifted (-0.5w+tthin,-tfat*theight+0.5tthin);
203         draw_trill_three;
204         currentpicture := currentpicture xscaled -1;
205 fet_endchar;