(interpret_stencil_expression): bugfix
[lilypond.git] / mf / feta-slag.mf
blobbc74235e10aec0509419843cbbc19eb3ae55cbba
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--2004 Jan Nieuwenhuizen <janneke@gnu.org>
8
10 % this file is included by feta-scripts.mf
12 trill_thin# = 0.1 staff_space# + 0.6 stafflinethickness#;
13 trill_thick# = 1/2 staff_space#;
14 trill_width# = 5/12 staff_space#;
15 trill_height# = 1/2staff_space#;
16 trill_overlap# = 1/6 staff_space#;
18 pair trill_ne;
19 trill_ne := unitvector ((6,9));
21 define_pixels (trill_thick, trill_thin, 
22                 trill_width, trill_overlap, trill_height);
26 % the trill element sticks out on both the left and right side
27 % out of the normal bbox, so you can glue them together easily.
29 def draw_trillelement (expr startx) =
30 begingroup
31         clearxy;
32         save x, y, p;
34         pickup pencircle scaled trill_thin;
35         
36         x1 = - trill_width;
37         y1 = 0;
38         z3 = whatever * trill_ne + z1;
39         top y3 = trill_height;
40         z2 =  z3 - (trill_thick - trill_thin) * trill_ne;
42         z4 = z1 - trill_ne * trill_overlap;
44         path p;
45         p = z3 -- z2 -- z4 -- z2;
46         p := p -- (p scaled -1) -- cycle;
47         %pickup pencircle scaled 2;
48         filldraw (p shifted (startx + trill_width,0)) ;
49         %draw p;
50         labels(1,2,3,4);
51 endgroup;
52 enddef;
57 fet_beginchar("trilelement", "trilelement", "trilelement")
58         set_char_box(trill_width#, trill_width#,
59                                 trill_height#, trill_height#);
60         draw_trillelement(-trill_width);
61 fet_endchar;
63 fet_beginchar("prall", "prall", "prall")
64         set_char_box(2 trill_width#, 2 trill_width#,
65                      trill_height#, trill_height#);
66         draw_trillelement(-2 trill_width);
67         draw_trillelement(0);
68 fet_endchar;
70 fet_beginchar("mordent", "mordent", "mordent")
71         set_char_box(2 trill_width#, 2 trill_width#,
72                         4/3 trill_height#, 4/3 trill_height#);
73         draw_trillelement(-2 trill_width);
74         draw_trillelement(0);
76         pickup pencircle scaled trill_thin;
77         top y1 = h;
78         bot y2 = -d;
79         x1 = x2 ;
80         x2 = 0;
81         draw z1 -- z2;
82 fet_endchar;
84 fet_beginchar("prallprall", "prallprall", "prallprall")
85         set_char_box(3 trill_width#, 3 trill_width#,
86                      trill_height#, trill_height#);
87         draw_trillelement(-3 trill_width);
88         draw_trillelement(-1 trill_width);
89         draw_trillelement(1 trill_width);
90 fet_endchar;
92 fet_beginchar("prallmordent", "prallmordent", "prallmordent")
94         set_char_box(3 trill_width#, 3 trill_width#,
95                      4/3 trill_height#, 4/3trill_height#);
96         draw_trillelement(-3 trill_width);
97         draw_trillelement(-1 trill_width);
98         draw_trillelement(1 trill_width);
100         pickup pencircle scaled trill_thin;
101         top y1 = h;
102         bot y2 = -d;
103         x1 = x2 ;
104         x2 = trill_width;
105         draw z1 -- z2;
106 fet_endchar;
108 save remember_pic;
109 picture remember_pic;
111 fet_beginchar("upprall", "upprall", "upprall")
112         set_char_box(3 trill_width#, 3 trill_width#,
113                       trill_height#, trill_height#);
114         draw_trillelement(-3 trill_width);
115         draw_trillelement(-1 trill_width);
116         draw_trillelement(1 trill_width);
119         z1 = (- b,0) - trill_overlap * trill_ne ;
120         z4 = z1 + (0, - 2 trill_height);
121         labels (1,4);
122         draw z1{-trill_ne} .. z4{trill_ne yscaled  -1};
123         remember_pic := currentpicture ;
124 fet_endchar;
126 fet_beginchar("upmordent", "upmordent", "upmordent")
127         set_char_box(3 trill_width#, 3 trill_width#,
128                       4/3 trill_height#, 4/3 trill_height#);
130         currentpicture := remember_pic;
132         pickup pencircle scaled trill_thin;
133         top y1 = h;
134         bot y2 = -d;
135         x1 = x2 ;
136         x2 = trill_width;
137         draw z1 -- z2;
138 fet_endchar;
140 fet_beginchar("pralldown", "pralldown", "pralldown")
141         set_char_box(3 trill_width#, 3 trill_width#,
142                       trill_height#, trill_height#);
143         currentpicture := remember_pic xscaled -1;
144 fet_endchar;
146 fet_beginchar("downprall", "downprall", "downprall")
147         set_char_box(3 trill_width#, 3 trill_width#,
148                       trill_height#, trill_height#);
149         remember_pic := currentpicture;
150         draw_trillelement(-3 trill_width);
151         draw_trillelement(-1 trill_width);
152         draw_trillelement(1 trill_width);
155         z1 = (- b,0) - trill_overlap * trill_ne ;
156         z4 = z1 + (0, 2 trill_height);
157         labels (1,4);
158         draw z1{trill_ne xscaled -1} .. z4{trill_ne};
159         remember_pic := currentpicture ;
161 fet_endchar;
163 fet_beginchar("downmordent", "downmordent", "downmordent")
164         set_char_box(3 trill_width#, 3 trill_width#,
165                     4/3  trill_height#, 4/3trill_height#);
167         currentpicture := remember_pic;
169         pickup pencircle scaled trill_thin;
170         top y1 = h;
171         bot y2 = -d;
172         x1 = x2 ;
173         x2 = trill_width;
174         draw z1 -- z2;
175 fet_endchar;
177 fet_beginchar("prallup", "prallup", "prallup")
178         set_char_box(3 trill_width#, 3 trill_width#,
179                       trill_height#, trill_height#);
180         currentpicture := remember_pic xscaled -1;
181 fet_endchar;
184 fet_beginchar("lineprall", "lineprall", "lineprall")
185         set_char_box(3 trill_width#, 3 trill_width#,
186                       trill_height#, 4trill_height#);
187         remember_pic := currentpicture;
188         draw_trillelement(-3 trill_width);
189         draw_trillelement(-1 trill_width);
190         draw_trillelement(1 trill_width);
192         
193         z1 = (- b,0) - trill_overlap * trill_ne ;
194         z4 = z1 + (0, h);
195         labels (1,4);
196         draw z1 -- z4;
197 fet_endchar;