X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mf%2Ffeta-ties.mf;h=c2124b88e9c051e0c40d745754966d661b00203c;hb=90e4d7057f3857da049dfda3d130017d4719bd6b;hp=4378d576d85b1b08c7d3629141eff4bf320ca3c0;hpb=a066a93ee74edebb9d238a1bac93c3bc7e8e6e4a;p=lilypond.git diff --git a/mf/feta-ties.mf b/mf/feta-ties.mf index 4378d576d8..c2124b88e9 100644 --- a/mf/feta-ties.mf +++ b/mf/feta-ties.mf @@ -1,12 +1,12 @@ % Feta (not the Font-En-Tja) music font -- small ties % This file is part of LilyPond, the GNU music typesetter. % -% Copyright (C) 2011 Bertrand Bordage +% Copyright (C) 2011--2015 Bertrand Bordage % -% 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 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 @@ -18,29 +18,55 @@ fet_begingroup ("ties"); -fet_beginchar ("lyric tie", "lyric"); - save padding; +save min_width, max_width, min_height, max_height, thin, thick; - padding := .4 staff_space; +min_width:= .5 staff_space#; +max_width:= 5 staff_space#; +min_height := .2 staff_space#; +max_height := .4 staff_space#; +thin := 1.2 linethickness; +thick := 2 linethickness; - set_char_box (0, 0, - .7 staff_space#, 0); - z1 = (-staff_space, -padding); +def draw_lyric_tie (expr width_sharp) = + save padding, angularity, width, height, depth; + + padding# := .4 staff_space#; + angularity := 2.5; + width# := max (min (width_sharp, max_width), min_width); + height# := (max (width# - min_width, 0) / (max_width - min_width)) + [min_height, max_height]; + depth# := padding# + height#; + + set_char_box (0, 0, depth#, 0); + + define_pixels (width, padding); + + z1 = (-width / 2, -padding); z2 = (0, -d); - z3 = (staff_space, -padding); + z3 = (width / 2, -padding); - penpos1 (1.2 linethickness, 50); - penpos2 (2 linethickness, 90); - penpos3 (1.2 linethickness, 130); + penpos1 (thin, angularity * angle (z2 - z1) + 90); + penpos2 (thick, 90); + penpos3 (thin, angularity * angle (z3 - z2) + 90); fill z2l - .. simple_serif (z3l, z3r, 90) - .. z2r - .. simple_serif (z1r, z1l, 90) - .. cycle; + .. simple_serif (z3l, z3r, 90) + .. z2r + .. simple_serif (z1r, z1l, 90) + .. cycle; penlabels (1, 2, 3); +enddef; + + +fet_beginchar ("Short lyric tie", "lyric.short"); + draw_lyric_tie (1.25 staff_space#); +fet_endchar; + + +fet_beginchar ("Default lyric tie", "lyric.default"); + draw_lyric_tie (1.75 staff_space#); fet_endchar; fet_endgroup ("ties");