X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mf%2Ffeta-accordion.mf;h=4b8640b8c22546eee8abd33cef1a03a4e02bae09;hb=HEAD;hp=3920e36c4d4458fd2c526b41738cc53b062b919c;hpb=de0fb7239295233a76b26fbda5b989142653cac7;p=lilypond.git diff --git a/mf/feta-accordion.mf b/mf/feta-accordion.mf index 3920e36c4d..4b8640b8c2 100644 --- a/mf/feta-accordion.mf +++ b/mf/feta-accordion.mf @@ -1,12 +1,13 @@ % 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 +% Copyright (C) 1998--2015 Han-Wen Nienhuys % -% LilyPond is free software: you can redistribute it and/or modify +% 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. +% (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 @@ -39,12 +40,13 @@ fet_beginchar ("accordion register discant", "discant") set_char_box (r# + accreg_linethickness# / 2, r# + accreg_linethickness# / 2, - 0, 2 r# + 0.7 accreg_linethickness#); + 0.7 accreg_linethickness# / 2, + 2 r# + 0.7 accreg_linethickness# / 2); lh = vround (2/3 r); lt = vround (0.7 accreg_linethickness); - - h := 3 lh + lt; + 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); @@ -52,10 +54,10 @@ fet_beginchar ("accordion register discant", "discant") penpos3 (hround accreg_linethickness, 180); penpos4 (lt, 270); - z1r = (w, h / 2); + z1r = (w, 0.5 [-d, h]); z2r = (0, h); - z3r = (-b, h / 2); - z4r = (0, 0); + z3r = (-b, 0.5 [-d, h]); + z4r = (0, -d); penlabels (1, 2, 3, 4); @@ -87,9 +89,9 @@ fet_beginchar ("accordion register discant", "discant") pickup penrazor scaled lt rotated 90; - top z5 = pat intersectionpoint ((0, lh + lt) -- (w, lh + lt)); + top z5 = pat intersectionpoint ((0, lh + lt - d) -- (w, lh + lt - d)); z6 = z5 xscaled -1; - bot z7 = pat intersectionpoint ((0, 2 lh) -- (w, 2 lh)); + bot z7 = pat intersectionpoint ((0, 2 lh - d) -- (w, 2 lh - d)); z8 = z7 xscaled -1; labels (5, 6, 7, 8); @@ -122,12 +124,13 @@ fet_beginchar ("accordion register freebass", "freebass") set_char_box (r# + accreg_linethickness# / 2, r# + accreg_linethickness# / 2, - 0, 2 r# + 0.7 accreg_linethickness#); + 0.7 accreg_linethickness# / 2, + 2 r# + 0.7 accreg_linethickness# / 2); lh = vround r; lt = vround (0.7 accreg_linethickness); - - h := 2 lh + lt; + d := vround (0.7 accreg_linethickness / 2); + h := 2 lh + lt - d; b := w := (2 lh + hround accreg_linethickness) / 2; penpos1 (hround accreg_linethickness, 0); @@ -135,10 +138,10 @@ fet_beginchar ("accordion register freebass", "freebass") penpos3 (accreg_linethickness, 180); penpos4 (lt, 270); - z1r = (w, h / 2); + z1r = (w, 0.5 [-d, h]); z2r = (0, h); - z3r = (-b, h / 2); - z4r = (0, 0); + z3r = (-b, 0.5 [-d, h]); + z4r = (0, -d); penlabels (1, 2, 3, 4); @@ -180,12 +183,13 @@ fet_beginchar ("accordion register stdbass", "stdbass") set_char_box (r# + accreg_linethickness# / 2, r# + accreg_linethickness# / 2, - 0, 2 r# + 0.7 accreg_linethickness#); + 0.7 accreg_linethickness# / 2, + 2 r# + 0.7 accreg_linethickness# / 2); lh = vround (1/2 r); lt = vround (0.7 accreg_linethickness); - - h := 4 lh + lt; + d := vround (0.7 accreg_linethickness / 2); + h := 4 lh + lt - d; b := w := (4 lh + hround accreg_linethickness) / 2; penpos1 (hround accreg_linethickness, 0); @@ -193,10 +197,10 @@ fet_beginchar ("accordion register stdbass", "stdbass") penpos3 (hround accreg_linethickness, 180); penpos4 (lt, 270); - z1r = (w, h / 2); + z1r = (w, 0.5 [-d, h]); z2r = (0, h); - z3r = (-b, h / 2); - z4r = (0, 0); + z3r = (-b, 0.5 [-d, h]); + z4r = (0, -d); penlabels (1, 2, 3, 4); @@ -228,9 +232,9 @@ fet_beginchar ("accordion register stdbass", "stdbass") pickup penrazor scaled lt rotated 90; - top z5 = pat intersectionpoint ((0, lh + lt) -- (w, lh + lt)); + top z5 = pat intersectionpoint ((0, lh + lt - d) -- (w, lh + lt - d)); z6 = z5 xscaled -1; - bot z7 = pat intersectionpoint ((0, 3 lh) -- (w, 3 lh)); + bot z7 = pat intersectionpoint ((0, 3 lh - d) -- (w, 3 lh - d)); z8 = z7 xscaled -1; labels (5, 6, 7, 8); @@ -252,24 +256,26 @@ fet_beginchar ("accordion register bayanbass", "bayanbass") set_char_box (accreg_lh# + accreg_linethickness# / 2, accreg_lh# + accreg_linethickness# / 2, - 0, 3 accreg_lh# + accreg_linethickness#); + accreg_linethickness# / 2, + 3 accreg_lh# + accreg_linethickness# / 2); - h := 3 lh + lt; + d := vround (accreg_linethickness# / 2); + h := 3 lh + lt - d; - draw_rounded_block ((-w, 0), (-w + lt, h), lt); - draw_rounded_block ((w - lt, 0), (w, h), lt); + draw_rounded_block ((-w, -d), (-w + lt, h), lt); + draw_rounded_block ((w - lt, -d), (w, h), lt); pickup penrazor scaled lt rotated 90; - bot z1 = (-w + lt / 2, 0); - bot z2 = (-w + lt / 2, lh); - bot z3 = (-w + lt / 2, 2 lh); - bot z4 = (-w + lt / 2, 3 lh); + bot z1 = (-w + lt / 2, -d); + bot z2 = (-w + lt / 2, lh - d); + bot z3 = (-w + lt / 2, 2 lh - d); + bot z4 = (-w + lt / 2, 3 lh - d); - bot z5 = (w - lt / 2, 0); - bot z6 = (w - lt / 2, lh); - bot z7 = (w - lt / 2, 2 lh); - bot z8 = (w - lt / 2, 3 lh); + bot z5 = (w - lt / 2, -d); + bot z6 = (w - lt / 2, lh - d); + bot z7 = (w - lt / 2, 2 lh - d); + bot z8 = (w - lt / 2, 3 lh - d); draw z1 -- z5; @@ -452,6 +458,7 @@ fet_beginchar ("accordion oldEE", "oldEE") fi; fet_endchar; + fet_beginchar ("accordion push", "push"); save width, height; @@ -474,21 +481,42 @@ fet_beginchar ("accordion push", "push"); top y1 = height; rt x2 = 0; - y2 = 0.5 * (y1+y3); + y2 = 0.5 * (y1 + y3); - x3= x1; + x3 = x1; bot y3 = 0; - save pat; - - path pat; - - pat = z1 -- z2 -- z3; - - draw pat; - + 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; @@ -525,24 +553,17 @@ fet_beginchar ("accordion pull", "pull"); x5 = x1; y5 = y4; - save pat; - - path pat; - - pat = 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; - - fill pat; - + 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");