1 % -*- Fundamental -*- (emacs-20 mf mode mucks
2 % feta-slag.mf -- implement trill symbols
4 % source file of the Feta (defintively not an abbreviation for Font-En-Tja)
7 % (c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
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#;
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) =
34 pickup pencircle scaled trill_thin;
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;
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)) ;
57 fet_beginchar("trilelement", "trilelement", "trilelement")
58 set_char_box(trill_width#, trill_width#,
59 trill_height#, trill_height#);
60 draw_trillelement(-trill_width);
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);
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);
76 pickup pencircle scaled trill_thin;
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);
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;
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);
122 draw z1{-trill_ne} .. z4{trill_ne yscaled -1};
123 remember_pic := currentpicture ;
126 fet_beginchar("upmordent", "upmordent", "upmordent")
127 set_char_box(3 trill_width#, 3 trill_width#,
128 trill_height#, trill_height#);
130 currentpicture := remember_pic;
132 pickup pencircle scaled trill_thin;
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;
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);
158 draw z1{trill_ne xscaled -1} .. z4{trill_ne};
159 remember_pic := currentpicture ;
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;
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;
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);
193 z1 = (- b,0) - trill_overlap * trill_ne ;