]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-bolletjes.mf
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / mf / feta-bolletjes.mf
index 526e0c6bebe76d80f924661c84e549561ffdabb6..c09c3d2df9c4bba4d55194b66350f3778315b142 100644 (file)
@@ -3,7 +3,7 @@
 %
 % source file of LilyPond's pretty-but-neat music font
 %
-% (c) 1997--2005 Jan Nieuwenhuizen <janneke@gnu.org>
+% (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
 % & Han-Wen Nienhuys <hanwen@xs4all.nl>
 % & Juergen Reuter <reuter@ipd.uka.de>
 %
@@ -26,8 +26,14 @@ picture remember_pic;
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
 save black_notehead_width, noteheight;
-save slash_thick, slash_slope, overdone_heads;
-numeric black_notehead_width, noteheight, slash_thick;
+save half_notehead_width, whole_notehead_width, slash_thick;
+save slash_slope, overdone_heads, solfa_noteheight;
+
+numeric noteheight;
+numeric slash_thick;
+numeric black_notehead_width;
+numeric whole_notehead_width;
+numeric half_notehead_width;
 
 
 fet_begingroup ("noteheads");
@@ -48,6 +54,12 @@ slash_thick# := 2/3 * 0.48 staff_space#;
 overdone_heads = 0.0;
 noteheight# := staff_space# + (1 + overdone_heads) * stafflinethickness#;
 
+
+%
+% solfa heads should not overlap on chords.
+%
+solfa_noteheight# := staff_space# - stafflinethickness#;
+
 define_pixels (slash_thick);
 define_whole_vertical_pixels (noteheight);
 
@@ -185,6 +197,8 @@ fet_beginchar ("Whole notehead", "s0");
        undraw_inside_ellipse (1.30, 125 - puff_up_factor * 10,
                               0.68, 2 stafflinethickness#);
 
+       whole_notehead_width# := charwd;
+
        draw_staff (-2, 2, 0);
 fet_endchar;
 
@@ -201,10 +215,14 @@ if test > 0:
 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);
 fet_endchar;
 
@@ -229,7 +247,6 @@ fet_beginchar ("Quart notehead", "s2");
        draw_staff (-2, 2, 0);
 fet_endchar;
 
-
 if test > 0:
        fet_beginchar ("Quart notehead", "s2");
                draw_outside_ellipse (1.49 - puff_up_factor / 3.0, 31,
@@ -319,6 +336,10 @@ endgroup
 enddef;
 
 
+%
+%
+% UGH : xs not declared as argument.
+%
 def define_triangle_shape (expr stemdir) =
        save triangle_a, triangle_b, triangle_c;
        save triangle_out_a, triangle_out_b, triangle_out_c;
@@ -422,16 +443,17 @@ def define_triangle_shape (expr stemdir) =
                       & {direction infinity of triangle_out_c}z1'l
                       .. cycle;
 
+
        labels (0, 10, 20, 30);
        penlabels (1, 1', 2, 2', 3, 3', 12, 23, 31);
 
        % attachment Y
        if stemdir = 1:
                charwy := ypart exact_right_point;
-               charwx := xpart exact_right_point;
+               charwx := xpart exact_right_point + .5 pen_thick# * xs;
        else:
                charwy := -ypart exact_down_point;
-               charwx := (width# - xpart exact_down_point);
+               charwx := (width# - (xpart exact_down_point - 0.5 * xs * pen_thick#));
        fi
 enddef;
 
@@ -486,14 +508,14 @@ def draw_small_triangle_head (expr dir) =
 enddef;
 
 
-fet_beginchar ("Half trianglehead", "d1triangle");
+fet_beginchar ("Half trianglehead (downstem)", "d1triangle");
        draw_small_triangle_head (-1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
 
 
-fet_beginchar ("Half trianglehead", "u1triangle");
+fet_beginchar ("Half trianglehead (upstem)", "u1triangle");
        draw_small_triangle_head (1);
 
        draw_staff (-2, 2, 0.5);
@@ -514,14 +536,14 @@ def draw_closed_triangle_head (expr dir) =
 enddef;
 
 
-fet_beginchar ("Quart trianglehead", "u2triangle");
+fet_beginchar ("Quart trianglehead (upstem)", "u2triangle");
        draw_closed_triangle_head (1);
 
        draw_staff (-2, 2, 0);
 fet_endchar;
 
 
-fet_beginchar ("Quart trianglehead", "d2triangle");
+fet_beginchar ("Quart trianglehead (downstem)", "d2triangle");
        draw_closed_triangle_head (-1);
 
        draw_staff (-2, 2, 0.5);
@@ -585,8 +607,8 @@ def draw_slash (expr hwid_hash) =
                z6 - z5 = whatever * ne;
                z8 - z7 = whatever * ne;
 
-               z5  = z1 + whatever * ne + th * (ne rotated -90);
-               z8  = z4 + whatever * ne + th * (ne rotated 90);
+               z5 = z1 + whatever * ne + th * (ne rotated -90);
+               z8 = z4 + whatever * ne + th * (ne rotated 90);
 
                unfill z5
                       -- z6
@@ -881,18 +903,25 @@ fi;
 %
 
 save solfa_pen_thick;
-solfa_pen_thick# = 2 stafflinethickness#;
+solfa_pen_thick# = 1.75 stafflinethickness#;
 define_blacker_pixels (solfa_pen_thick);
 
 
+save solfa_base_notewidth;
+solfa_base_notewidth# := black_notehead_width#;
+
+solfa_whole_width := whole_notehead_width# / black_notehead_width#;
+solfa_half_width := half_notehead_width# / black_notehead_width#;
+solfa_quarter_width := 1.0;
+
 def draw_do_head (expr width_factor, dir) =
        save p_in, p_out;
        save left_dist, right_dist;
        path p_in, p_out;
        pair left_dist, right_dist;
 
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_base_notewidth#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        pickup pencircle scaled solfa_pen_thick;
 
@@ -937,34 +966,34 @@ enddef;
 
 
 fet_beginchar ("Whole dohead", "s0do");
-       draw_do_head (1.8, 1);
+       draw_do_head (solfa_whole_width, 1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half dohead", "d1do");
-       draw_do_head (1.5, -1);
+       draw_do_head (solfa_half_width, -1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half dohead", "u1do");
-       draw_do_head (1.5, 1);
+       draw_do_head (solfa_half_width, 1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Quart dohead", "d2do");
-       draw_do_head (1.55, -1);
+       draw_do_head (solfa_quarter_width, -1);
        fill p_out;
 fet_endchar;
 
 
 fet_beginchar ("Quart dohead", "u2do");
-       draw_do_head (1.55, 1);
+       draw_do_head (solfa_quarter_width, 1);
        fill p_out;
 fet_endchar;
 
@@ -981,8 +1010,8 @@ def draw_re_head (expr width_factor, dir) =
        save p_in, p_out;
        path p_in, p_out;
 
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_noteheight#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        pickup pencircle scaled solfa_pen_thick;
 
@@ -1027,34 +1056,34 @@ enddef;
 
 
 fet_beginchar ("Whole rehead", "s0re");
-       draw_re_head (1.8, 1);
+       draw_re_head (solfa_whole_width, 1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half up rehead", "u1re");
-       draw_re_head (1.5, 1);
+       draw_re_head (solfa_half_width, 1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half down rehead", "d1re");
-       draw_re_head (1.5, -1);
+       draw_re_head (solfa_half_width, -1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Quart rehead", "u2re");
-       draw_re_head (1.55, 1);
+       draw_re_head (solfa_quarter_width, 1);
        fill p_out;
 fet_endchar;
 
 
 fet_beginchar ("Quart rehead", "d2re");
-       draw_re_head (1.55, -1);
+       draw_re_head (solfa_quarter_width, -1);
        fill p_out;
 fet_endchar;
 
@@ -1065,8 +1094,8 @@ def draw_mi_head (expr width_factor) =
        path path_out, path_in;
        pair ne_dist, se_dist, ne, se;
 
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_noteheight#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        pickup pencircle scaled solfa_pen_thick;
 
@@ -1120,28 +1149,28 @@ enddef;
 
 
 fet_beginchar ("Whole mihead", "s0mi");
-       draw_mi_head (1.8);
+       draw_mi_head (solfa_whole_width);
        fill path_out;
        unfill path_in;
 fet_endchar;
 
 
 fet_beginchar ("Half mihead", "s1mi");
-       draw_mi_head (1.6);
+       draw_mi_head (solfa_quarter_width);
        fill path_out;
        unfill path_in;
 fet_endchar;
 
 
 fet_beginchar ("Quart mihead", "s2mi");
-       draw_mi_head (1.65);
+       draw_mi_head (solfa_quarter_width);
        fill path_out;
 fet_endchar;
 
 
 def draw_fa_head (expr width_factor) =
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_noteheight#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
 
        save p_down_in, p_down_out, p_up_in, p_up_out, nw_dist, nw;
        path p_down_in, p_down_out, p_up_in, p_up_out;
@@ -1191,48 +1220,48 @@ enddef;
 
 
 fet_beginchar ("Whole fa up head", "u0fa");
-       draw_fa_head (1.8);
+       draw_fa_head (solfa_whole_width);
        fill p_up_out;
        unfill p_up_in;
 fet_endchar;
 
 
 fet_beginchar ("Whole fa down head", "d0fa");
-       draw_fa_head (1.8);
+       draw_fa_head (solfa_whole_width);
        fill p_down_out;
        unfill p_down_in;
 fet_endchar;
 
 
 fet_beginchar ("half fa up head", "u1fa");
-       draw_fa_head (1.5);
+       draw_fa_head (solfa_half_width);
        fill p_up_out;
        unfill p_up_in;
 fet_endchar;
 
 
 fet_beginchar ("Half fa down head", "d1fa");
-       draw_fa_head (1.5);
+       draw_fa_head (solfa_half_width);
        fill p_down_out;
        unfill p_down_in;
 fet_endchar;
 
 
 fet_beginchar ("Quarter fa up head", "u2fa");
-       draw_fa_head (1.55);
+       draw_fa_head (solfa_quarter_width);
        fill p_up_out;
 fet_endchar;
 
 
 fet_beginchar ("Quarter fa down head", "d2fa");
-       draw_fa_head (1.55);
+       draw_fa_head (solfa_quarter_width);
        fill p_down_out;
 fet_endchar;
 
 
 def draw_la_head (expr width_factor) =
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_noteheight#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
        save p_in, p_out;
        path p_in, p_out;
 
@@ -1270,28 +1299,28 @@ enddef;
 
 
 fet_beginchar ("Whole lahead", "s0la");
-       draw_la_head (1.8);
+       draw_la_head (solfa_whole_width);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half lahead", "s1la");
-       draw_la_head (1.5);
+       draw_la_head (solfa_half_width);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Quart lahead", "s2la");
-       draw_la_head (1.55);
+       draw_la_head (solfa_quarter_width);
        fill p_out;
 fet_endchar;
 
 
 def draw_ti_head (expr width_factor, dir) =
-       set_char_box (0, width_factor * noteheight#,
-                     0.5 noteheight#, 0.5 noteheight#);
+       set_char_box (0, width_factor * solfa_noteheight#,
+                     0.5 solfa_noteheight#, 0.5 solfa_noteheight#);
        save p_in, p_out, p_top;
        save nw_dist, sw_dist, nw, sw;
        path p_in, p_out, p_top;
@@ -1352,34 +1381,34 @@ enddef;
 
 
 fet_beginchar ("Whole up tihead", "s0ti");
-       draw_ti_head (1.8, 1);
+       draw_ti_head (solfa_whole_width, 1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half up tihead", "u1ti");
-       draw_ti_head (1.5, 1);
+       draw_ti_head (solfa_half_width, 1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Half down tihead", "d1ti");
-       draw_ti_head (1.5, -1);
+       draw_ti_head (solfa_half_width, -1);
        fill p_out;
        unfill p_in;
 fet_endchar;
 
 
 fet_beginchar ("Quart up tihead", "u2ti");
-       draw_ti_head (1.55, 1);
+       draw_ti_head (solfa_quarter_width, 1);
        fill p_out;
 fet_endchar;
 
 
 fet_beginchar ("Quart down tihead", "d2ti");
-       draw_ti_head (1.55, -1);
+       draw_ti_head (solfa_quarter_width, -1);
        fill p_out;
 fet_endchar;