-% -*- Fundamental -*-
+% Feta (not the Font-En-Tja) music font -- draw accordion symbols
+% This file is part of LilyPond, the GNU music typesetter.
+%
+% Copyright (C) 1998--2010 Han-Wen Nienhuys <hanwen@xs4all.nl>
+%
+% LilyPond 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.
+%
+% 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.
define_pixels (accreg_dot_size, accreg_linethickness, accreg_lh);
-fet_beginchar ("accDiscant", "accDiscant")
+fet_beginchar ("accordion register discant", "discant")
save r, pat, lh, lt;
path pat;
% mf doesn't handle pixel dropouts in outline objects, so we use
% `draw' if not called by mpost
if known miterlimit:
- penstroke z1e
- .. z2e
- .. z3e
- .. z4e
- .. cycle;
+ fill z1r
+ .. z2r
+ .. z3r
+ .. z4r
+ .. cycle;
+ unfill z1l
+ .. z2l
+ .. z3l
+ .. z4l
+ .. cycle;
else:
pickup pencircle xscaled accreg_linethickness yscaled lt;
draw z1
fet_endchar;
-fet_beginchar ("accDot", "accDot")
+fet_beginchar ("accordion register dot", "dot")
set_char_box (accreg_dot_size# / 2, accreg_dot_size# / 2,
accreg_dot_size# / 2, accreg_dot_size# / 2);
fet_endchar;
-fet_beginchar ("accFreebase", "accFreebase")
+fet_beginchar ("accordion register freebass", "freebass")
save r, lh, lt;
r# = accreg_lh#;
% mf doesn't handle pixel dropouts in outline objects, so we use
% `draw' if not called by mpost
if known miterlimit:
- penstroke z1e
- .. z2e
- .. z3e
- .. z4e
- .. cycle;
+ fill z1r
+ .. z2r
+ .. z3r
+ .. z4r
+ .. cycle;
+ unfill z1l
+ .. z2l
+ .. z3l
+ .. z4l
+ .. cycle;
else:
pickup pencircle xscaled accreg_linethickness yscaled lt;
draw z1
fet_endchar;
-fet_beginchar ("accStdbase", "accStdbase")
+fet_beginchar ("accordion register stdbass", "stdbass")
save r, p, lh, lt;
path pat;
% mf doesn't handle pixel dropouts in outline objects, so we use
% `draw' if not called by mpost
if known miterlimit:
- penstroke z1e
- .. z2e
- .. z3e
- .. z4e
- .. cycle;
+ fill z1r
+ .. z2r
+ .. z3r
+ .. z4r
+ .. cycle;
+ unfill z1l
+ .. z2l
+ .. z3l
+ .. z4l
+ .. cycle;
else:
pickup pencircle xscaled accreg_linethickness yscaled lt;
draw z1
fet_endchar;
-fet_beginchar ("accBayanbase", "accBayanbase")
+fet_beginchar ("accordion register bayanbass", "bayanbass")
save lh, lt;
lh = vround accreg_lh;
enddef;
-fet_beginchar ("accOldEE", "accOldEE")
+fet_beginchar ("accordion oldEE", "oldEE")
save r, pp, ir, lh, lt, stroke_width;
r# = staff_space#;
pickup pencircle scaled (lr + blot_diameter);
- for pp := 0 step 45 until 180:
+ for pp := 0 step 45 until 135:
drawdot z2 rotated pp;
drawdot z3 rotated pp;
% mf doesn't handle pixel dropouts in outline objects, so we use
% `draw' if not called by mpost
if known miterlimit:
- penstroke z10e
- .. z11e
- .. z12e
- .. z13e
- .. cycle;
+ fill z10r
+ .. z11r
+ .. z12r
+ .. z13r
+ .. cycle;
+ unfill z10l
+ .. z11l
+ .. z12l
+ .. z13l
+ .. cycle;
else:
pickup pencircle xscaled accreg_linethickness yscaled lt;
draw z10
fet_endchar;
+fet_beginchar ("accordion push", "push");
+ save width, height;
+
+ height# := 2.0 staff_space# + 3.0 stafflinethickness#;
+ width# := 0.4 height#;
+
+ define_pixels(height, width);
+
+ save linewidth;
+
+ linewidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (linewidth);
+
+ set_char_box (width#, 0,
+ 0, height#);
+
+ pickup pencircle scaled linewidth;
+
+ lft x1 = -width;
+ top y1 = height;
+
+ rt x2 = 0;
+ y2 = 0.5 * (y1 + y3);
+
+ x3 = x1;
+ bot y3 = 0;
+
+ save nw_offset, ne_offset;
+ pair nw_offset, ne_offset;
+ save sw_offset, se_offset, line_radius;
+ pair sw_offset, se_offset;
+
+ line_radius := linewidth / 2;
+ nw_offset := line_radius * unitvector (z1 - z2);
+ ne_offset := nw_offset rotated -90;
+ sw_offset := line_radius * unitvector (z3 - z2);
+ se_offset := sw_offset rotated 90;
+
+ z4 = ((z1 - ne_offset)
+ -- (z2 - ne_offset))
+ intersectionpoint
+ ((z2 - se_offset)
+ -- (z3 - se_offset));
+
+ fill z1 + ne_offset
+ -- z2 + ne_offset
+ .. rt z2 {down}
+ .. z2 + se_offset
+ -- z3 + se_offset
+ .. z3 + sw_offset {- se_offset}
+ .. z3 - se_offset
+ -- z4
+ -- z1 - ne_offset
+ .. z1 + nw_offset {ne_offset}
+ .. cycle;
+fet_endchar;
+
+
+fet_beginchar ("accordion pull", "pull");
+ save width, height;
+
+ height# := 2.0 staff_space# + 3.0 stafflinethickness#;
+ width# := 0.4 height#;
+
+ define_pixels(height, width);
+
+ save linewidth;
+
+ linewidth# := stafflinethickness# + .05 staff_space#;
+ define_whole_blacker_pixels (linewidth);
+
+ set_char_box (width# - linewidth#, linewidth#,
+ 0, height#);
+
+ pickup pencircle scaled linewidth;
+
+ save penradius;
+ penradius := linewidth / 2;
+
+ rt x1 = linewidth;
+ bot y1 = 0;
+
+ x2 = x1;
+ top y2 = height;
+
+ lft x3= -width + linewidth;
+ y3 = y2;
+
+ x4 = x3;
+ y4 = y2 - linewidth;
+
+ x5 = x1;
+ y5 = y4;
+
+ fill z1 + penradius * right {up}
+ -- z2 + penradius * right {up}
+ .. z2 + penradius * up {left}
+ -- z3 + penradius * up {left}
+ .. z3 + penradius * left {down}
+ -- z4 + penradius * left {down}
+ .. z4 + penradius * down {right}
+ -- z5 + penradius * (down + left)
+ -- z1 + penradius * left {down}
+ .. z1 + penradius * down {right}
+ .. cycle;
+fet_endchar;
+
fet_endgroup ("accordion");