X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=mf%2Ffeta-noteheads.mf;h=9d33f04678b735014307fcb3061bbab2524350af;hb=0b544cfb7332615ef809b71b57ab656741311ae1;hp=87d9034713359aeb5e9cd0d4266334c8cbbf23ae;hpb=a1ce4a26eb893c1f752d260394a977ab811e3368;p=lilypond.git diff --git a/mf/feta-noteheads.mf b/mf/feta-noteheads.mf index 87d9034713..9d33f04678 100644 --- a/mf/feta-noteheads.mf +++ b/mf/feta-noteheads.mf @@ -1,15 +1,14 @@ % Feta (not the Font-En-Tja) music font -- implement noteheads % This file is part of LilyPond, the GNU music typesetter. % -% Copyright (C) 1997--2011 Jan Nieuwenhuizen +% Copyright (C) 1997--2014 Jan Nieuwenhuizen % & Han-Wen Nienhuys % & Juergen Reuter % -% -% 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 @@ -22,16 +21,11 @@ test_outlines := 0; -save remember_pic; -picture remember_pic; - - % Most beautiful noteheads are pronounced, not circular, % and not even symmetric. % These examples are inspired by [Wanske]; see literature list. - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % NOTE HEAD VARIABLES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -82,47 +76,77 @@ endgroup; enddef; -% -% dimensions aren't entirely right. -% def draw_longa (expr up) = save stemthick, fudge; stemthick# = 2 stafflinethickness#; define_whole_blacker_pixels (stemthick); - fudge = hround (blot_diameter / 2); + % Longas of smaller design sizes should have their lines farther + % apart (the overlap with notehead ellipsoid should be smaller). + fudge = hround (blot_diameter + * min (max (-0.15, + (0.9 + - (20 / (design_size + 4)))), + 0.3)); draw_outside_ellipse (1.80, 0, 0.707, 0); undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#); pickup pencircle scaled stemthick; + % Longas of smaller design sizes should have their lines longer. + line_length := min (max (0.7, (64/60 - (design_size / 60))), 0.85); + + % Line lengths between 0.72 and 0.77 are not nice + % because they are neither separate nor connected + % when there is an interval of fourth. + if line_length < 0.75: + quanted_line_length := min (0.72, line_length); + else: + quanted_line_length := max (0.77, line_length); + fi; + + + final_line_length := quanted_line_length * staff_space; + + save boxtop, boxbot; + define_pixels (boxtop, boxbot); + if up: - bot y1 = -d; - top y2 = h; + bot y1 = -final_line_length; + top y2 = final_line_length; rt x1 - fudge = 0; x1 = x2; - fudge + lft x3 = w; + fudge + lft x3 = width; x4 = x3; top y4 = h + 3.0 staff_space; y3 = y1; + boxtop# := staff_space# * (quanted_line_length + 3.0) - stemthick# ; + boxbot# := staff_space# * quanted_line_length; else: bot y1 = -d - 3.0 staff_space; - top y2 = h; + top y2 = final_line_length; rt x1 - fudge = 0; x1 = x2; - fudge + lft x3 = w; + fudge + lft x3 = width; x4 = x3; y4 = y2; - bot y3 = -d; + bot y3 = -final_line_length; + boxtop# := staff_space# * quanted_line_length; + boxbot# := staff_space# * (quanted_line_length + 3.0) - stemthick# ; fi; draw_gridline (z1, z2, stemthick); draw_gridline (z3, z4, stemthick); + set_char_box (stemthick#, + width# + stemthick#, + boxbot#, + boxtop#); + labels (1, 2, 3, 4); enddef; @@ -130,33 +154,17 @@ enddef; fet_beginchar ("Longa notehead", "uM2"); draw_longa (true); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; fet_beginchar ("Longa notehead", "dM2"); draw_longa (false); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Longa notehead", "uM2"); - draw_longa (true); - - draw_staff (-2, 2, 0.5); - fet_endchar; - - - fet_beginchar ("Longa notehead", "dM2"); - draw_longa (false); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - def draw_brevis (expr linecount, line_thickness_multiplier) = save stemthick, fudge, gap; @@ -179,11 +187,6 @@ def draw_brevis (expr linecount, line_thickness_multiplier) = draw_outside_ellipse (1.80, 0, 0.707, 0); undraw_inside_ellipse (1.30, 125, 0.68, 2 stafflinethickness#); - set_char_box (stemthick# * linecount + gap# * (linecount - 1), - width# + stemthick# * linecount + gap# * (linecount - 1), - noteheight# / 2, - noteheight# / 2); - define_pixels (gap); pickup pencircle scaled stemthick; @@ -199,6 +202,11 @@ def draw_brevis (expr linecount, line_thickness_multiplier) = quanted_line_length := max (0.77, line_length); fi; + set_char_box (stemthick# * linecount + gap# * (linecount - 1), + width# + stemthick# * linecount + gap# * (linecount - 1), + staff_space# * quanted_line_length, + staff_space# * quanted_line_length); + bot y1 = -quanted_line_length * staff_space; top y2 = quanted_line_length * staff_space; rt x1 - fudge = 0; @@ -224,35 +232,17 @@ enddef; fet_beginchar ("Brevis notehead", "sM1"); draw_brevis (1, 1); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Brevis notehead", "sM1"); - draw_brevis(1, 1); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Double-lined brevis notehead", "sM1double"); draw_brevis (2, 0.8); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Double-lined brevis notehead", "sM1double"); - draw_brevis (2, 0.8); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Whole notehead", "s0"); draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, 0.707, 0); undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10, @@ -260,60 +250,26 @@ fet_beginchar ("Whole notehead", "s0"); whole_notehead_width# := charwd; - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Whole notehead", "s0"); - draw_outside_ellipse (1.80 - puff_up_factor / 3.0, 0, - 0.707, 0); - undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10, - 0.68, 2 stafflinethickness#); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Half notehead", "s1"); draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, 0.66, 0.17); undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#); half_notehead_width# := charwd; - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Half notehead", "s1"); - draw_outside_ellipse (1.53 - puff_up_factor / 3.0, 34, - 0.66, 0.17); - undraw_inside_ellipse (3.25, 33, 0.81, - 2.5 stafflinethickness#); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Quarter notehead", "s2"); draw_quarter_path; - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Quarter notehead", "s2"); - draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31, - 0.707, 0); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -322,58 +278,26 @@ fet_beginchar ("Whole diamondhead", "s0diamond"); undraw_inside_ellipse (1.30, 125, 0.6, .4 staff_space# + stafflinethickness#); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Whole diamondhead", "s0diamond"); - draw_outside_ellipse (1.80, 0, 0.495, 0); - undraw_inside_ellipse (1.30, 125, 0.6, - .4 staff_space# + stafflinethickness#); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Half diamondhead", "s1diamond"); draw_outside_ellipse (1.50, 34, 0.49, 0.17); undraw_inside_ellipse (3.5, 33, 0.80, .3 staff_space# + 1.5 stafflinethickness#); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Half diamondhead", "s1diamond"); - draw_outside_ellipse (1.50, 34, 0.49, 0.17); - undraw_inside_ellipse (3.5, 33, 0.80, - .3 staff_space# - + 1.5 stafflinethickness#); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Quarter diamondhead", "s2diamond"); draw_outside_ellipse (1.80, 35, 0.495, -0.25); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Quarter diamondhead", "s2diamond"); - draw_outside_ellipse (1.80, 35, 0.495, -0.25); - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -532,19 +456,10 @@ enddef; fet_beginchar ("Whole trianglehead", "s0triangle"); draw_whole_triangle_head; - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Whole trianglehead", "s0triangle"); - draw_whole_triangle_head; - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - def draw_small_triangle_head (expr dir) = save hei, xs; save llap; @@ -566,14 +481,14 @@ enddef; fet_beginchar ("Half trianglehead (downstem)", "d1triangle"); draw_small_triangle_head (-1); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; fet_beginchar ("Half trianglehead (upstem)", "u1triangle"); draw_small_triangle_head (1); - draw_staff (-2, 2, 0.5); + draw_staff_if_debugging (-2, 2); fet_endchar; @@ -594,14 +509,14 @@ enddef; fet_beginchar ("Quarter trianglehead (upstem)", "u2triangle"); draw_closed_triangle_head (1); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; fet_beginchar ("Quarter trianglehead (downstem)", "d2triangle"); draw_closed_triangle_head (-1); - draw_staff (-2, 2, 0.5); + draw_staff_if_debugging (-2, 2); fet_endchar; @@ -678,21 +593,21 @@ enddef; fet_beginchar ("Whole slashhead", "s0slash"); draw_slash (4 slash_thick# + 0.5 staff_space#); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; fet_beginchar ("Half slashhead", "s1slash"); draw_slash (3.0 slash_thick# + 0.15 staff_space#); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; fet_beginchar ("Quarter slashhead", "s2slash"); draw_slash (1.5 slash_thick#); - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; @@ -806,28 +721,10 @@ fet_beginchar ("Whole Crossed notehead", "s0cross"); draw_cross (3.75); - remember_pic := currentpicture; - - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Whole Crossed notehead", "s0cross"); - save wid, hei; - - wid# := black_notehead_width# + 4 stafflinethickness#; - hei# := noteheight# + stafflinethickness#; - - set_char_box (0, wid#, hei# / 2, hei# / 2); - - currentpicture := remember_pic; - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Half Crossed notehead", "s1cross"); save wid, hei; @@ -838,28 +735,10 @@ fet_beginchar ("Half Crossed notehead", "s1cross"); draw_cross (3.0); - remember_pic := currentpicture; - - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Half Crossed notehead", "s1cross"); - save wid, hei; - - wid# := black_notehead_width# + 2 stafflinethickness#; - hei# := noteheight# + stafflinethickness# / 2; - - set_char_box (0, wid#, hei# / 2, hei# / 2); - - currentpicture := remember_pic; - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("Crossed notehead", "s2cross"); wid# := black_notehead_width#; hei# := noteheight#; @@ -867,25 +746,10 @@ fet_beginchar ("Crossed notehead", "s2cross"); draw_cross (1.0); - remember_pic := currentpicture; - - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("Crossed notehead", "s2cross"); - wid# := black_notehead_width#; - hei# := noteheight#; - set_char_box (0, wid#, hei# / 2, hei# / 2); - - currentpicture := remember_pic; - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - fet_beginchar ("X-Circled notehead", "s2xcircle"); save wid, hei; save cthick, cxd, cyd, dy; @@ -931,29 +795,10 @@ fet_beginchar ("X-Circled notehead", "s2xcircle"); z12 = (charwx * hppp, charwy * vppp); labels (12); - remember_pic := currentpicture; - - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); fet_endchar; -if test > 0: - fet_beginchar ("X-Circled notehead", "s2xcircle"); - save wid, hei; - save cthick, cxr, cyr; - - wid# := black_notehead_width# * sqrt (sqrt2); - hei# := noteheight# * sqrt (sqrt2); - - set_char_box (0, wid#, hei# / 2, hei# / 2); - - currentpicture := remember_pic; - - draw_staff (-2, 2, 0.5); - fet_endchar; -fi; - - %%%%%%%% % % SOLFA SHAPED NOTES @@ -1605,7 +1450,7 @@ def draw_sol_head (expr filled) = if not filled: undraw_inside_ellipse (3.25, 33, 0.81, 2.5 stafflinethickness#); fi - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); enddef; fet_beginchar ("Whole solhead", "s0sol"); @@ -2224,7 +2069,7 @@ begingroup if not filled: undraw_inside_ellipse (1.9, 33, 0.74, 5.5 stafflinethickness#); fi - draw_staff (-2, 2, 0); + draw_staff_if_debugging (-2, 2); endgroup enddef;