-% -*- Fundamental -*-
-
-fet_begingroup("accordion")
-
-accreg_dot_size# := .5staff_space#;
-accreg_linethickness# := 1.3stafflinethickness#;
-
-% This dimention is the same on all registersymbols.
-% The different symbols should calculate their other
-% dimensions from this and accreg_dot_size
-accreg_lh# := 1.0staff_space#;
-
-define_pixels(accreg_dot_size, accreg_linethickness, accreg_lh);
-pen accreg_pen;
-accreg_pen := pencircle xscaled accreg_linethickness yscaled 0.7accreg_linethickness;
-
-fet_beginchar("accDiscant", "accDiscant", "accDiscant")
- save r, sx;
- r# = 3/2accreg_lh#;
- define_pixels(r);
-% set_char_box(r#, r#, 2r#, 0);
- set_char_box(r#, r#, 0r#, 2r#); %% arg3 = under linjen, arg4 = over
- pickup accreg_pen;
- draw fullcircle scaled 2r;
- sx = cosd(19.471221);
- draw (-sx*r, r/3)--(sx*r, r/3);
- draw (-sx*r, -r/3)--(sx*r, -r/3);
- currentpicture := currentpicture shifted (0, r);
+% Feta (not the Font-En-Tja) music font -- draw accordion symbols
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1998--2015 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+% The LilyPond font is free software: you can redistribute it and/or modify
+% it under the terms of the GNU General Public License as published by
+% the Free Software Foundation, either version 3 of the License, or
+% (at your option) any later version, or you can redistribute it under
+% the SIL Open Font License.
+%
+% LilyPond is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
+
+fet_begingroup ("accordion");
+
+%
+% These dimensions are the same for all register symbols.
+% The different symbols should calculate their other dimensions from them.
+%
+
+accreg_dot_size# := .5 staff_space#;
+accreg_linethickness# := 1.3 stafflinethickness#;
+accreg_lh# := 1.0 staff_space#;
+
+define_pixels (accreg_dot_size, accreg_linethickness, accreg_lh);
+
+
+fet_beginchar ("accordion register discant", "discant")
+ save r, pat, lh, lt;
+ path pat;
+
+ r# = 3/2 accreg_lh#;
+ define_pixels (r);
+
+ set_char_box (r# + accreg_linethickness# / 2,
+ r# + accreg_linethickness# / 2,
+ 0.7 accreg_linethickness# / 2,
+ 2 r# + 0.7 accreg_linethickness# / 2);
+
+ lh = vround (2/3 r);
+ lt = vround (0.7 accreg_linethickness);
+ d := vround (0.7 accreg_linethickness / 2);
+ h := 3 lh + lt - d;
+ b := w := (3 lh + hround accreg_linethickness) / 2;
+
+ penpos1 (hround accreg_linethickness, 0);
+ penpos2 (lt, 90);
+ penpos3 (hround accreg_linethickness, 180);
+ penpos4 (lt, 270);
+
+ z1r = (w, 0.5 [-d, h]);
+ z2r = (0, h);
+ z3r = (-b, 0.5 [-d, h]);
+ z4r = (0, -d);
+
+ penlabels (1, 2, 3, 4);
+
+ % mf doesn't handle pixel dropouts in outline objects, so we use
+ % `draw' if not called by mpost
+ if known miterlimit:
+ fill z1r
+ .. z2r
+ .. z3r
+ .. z4r
+ .. cycle;
+ unfill z1l
+ .. z2l
+ .. z3l
+ .. z4l
+ .. cycle;
+ else:
+ pickup pencircle xscaled accreg_linethickness yscaled lt;
+ draw z1
+ .. z2
+ .. z3
+ .. z4
+ .. cycle;
+ fi;
+
+ pat := z4{right}
+ .. z1{up}
+ .. {left}z2;
+
+ pickup penrazor scaled lt rotated 90;
+
+ top z5 = pat intersectionpoint ((0, lh + lt - d) -- (w, lh + lt - d));
+ z6 = z5 xscaled -1;
+ bot z7 = pat intersectionpoint ((0, 2 lh - d) -- (w, 2 lh - d));
+ z8 = z7 xscaled -1;
+
+ labels (5, 6, 7, 8);
+
+ draw z5
+ -- z6;
+ draw z7
+ -- z8;