2 % feta-arrow.mf -- draw arrow heads
4 % source file of the GNU LilyPond music typesetter
6 % (c) 2005--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
8 fet_begingroup ("arrowheads");
11 % To consider: we could put arrow heads at their real Unicode locations.
15 % Set up paths for upper half of arrow head pointing right.
16 % CLOSE_PATH is for a closed arrow, OPEN_PATH is for the open arrow.
17 % OPEN_TENSION sets the tension for the part which forms the path in
21 def set_arrow_paths (expr width, height, open_tension, arrowlinethickness) =
23 save tip_angle_o, tip_angle_c, tip_dir_c, tip_dir_o;
25 path pat, open_path, close_path;
26 pair tip_dir_o, tip_dir_c;
28 pickup pencircle scaled arrowlinethickness;
30 indent = linethickness / 2;
42 ..tension open_tension.. z2{right};
43 penpos2 (arrowlinethickness, 90);
44 tip_dir_o := direction 0.0 of pat;
45 tip_angle_o := angle (tip_dir_o);
46 penpos1 (arrowlinethickness, 90 + tip_angle_o);
48 penpos3 (arrowlinethickness, tip_angle_o);
50 open_path := z1r{tip_dir_o}
59 tip_dir_c := direction 0.0 of pat;
60 tip_angle_c := angle (tip_dir_c);
61 penpos4 (arrowlinethickness, 90+ tip_angle_c);
62 penpos5 (arrowlinethickness, 0);
64 penpos6 (arrowlinethickness, 90);
66 close_path := z4l{tip_dir_c}
71 ..tension open_tension.. z1r{-tip_dir_o}
77 fet_beginchar ("open", "open.01");
78 set_char_box (staff_space#, 1.6 linethickness# / 2,
79 0.5 staff_space#, 0.5 staff_space#);
80 set_arrow_paths (staff_space, 0.5 staff_space,
81 1.0, 1.6 linethickness);
83 open_path := open_path yscaled -1;
91 fet_beginchar ("open", "open.0M1");
92 set_char_box (1.6 linethickness# / 2, staff_space#,
93 0.5 staff_space#, 0.5 staff_space#);
94 set_arrow_paths (staff_space, 0.5 staff_space,
95 1.0, 1.6 linethickness);
97 open_path := open_path yscaled -1;
99 currentpicture := currentpicture xscaled -1;
103 fet_beginchar ("open", "open.11");
104 set_char_box (.5 staff_space#, .5 staff_space#,
105 1.0 staff_space#, 1.6 linethickness# / 2);
106 set_arrow_paths (staff_space, 0.5 staff_space,
107 1.0, 1.6 linethickness);
109 open_path := open_path yscaled -1;
111 currentpicture := currentpicture rotated 90;
115 fet_beginchar ("open", "open.1M1");
116 set_char_box (.5 staff_space#, .5 staff_space#,
117 1.6 linethickness# / 2, 1.0 staff_space#);
118 set_arrow_paths (staff_space, 0.5 staff_space,
119 1.0, 1.6 linethickness);
121 open_path := open_path yscaled -1;
123 currentpicture := currentpicture rotated 90;
124 currentpicture := currentpicture yscaled -1;
128 fet_beginchar ("close", "close.01");
129 set_char_box (staff_space#, 0, 0.5 staff_space#, 0.5 staff_space#);
130 set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
132 close_path := close_path yscaled -1;
137 fet_beginchar ("close", "close.0M1");
138 set_char_box (0, staff_space#, 0.5 staff_space#, 0.5 staff_space#);
139 set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
141 close_path := close_path yscaled -1;
143 currentpicture := currentpicture xscaled -1;
147 fet_beginchar ("close", "close.11");
148 set_char_box (.5 staff_space#, .5 staff_space#,
149 1.0 staff_space#, 0.0 staff_space#);
150 set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
152 close_path := close_path yscaled -1;
154 currentpicture := currentpicture rotated 90;
158 fet_beginchar ("close", "close.1M1");
159 set_char_box (.5 staff_space#, .5 staff_space#,
160 0.0 staff_space#, 1.0 staff_space#);
161 set_arrow_paths (staff_space, 0.5 staff_space, 1.5, blot_diameter);
163 close_path := close_path yscaled -1;
165 currentpicture := currentpicture rotated -90;
169 fet_endgroup ("arrowheads");