]> git.donarmstrong.com Git - lilypond.git/blobdiff - mf/feta-banier.mf
Run `make grand-replace'.
[lilypond.git] / mf / feta-banier.mf
index 7b21fd859fbbb476102f0814f150f806f22a960a..729dd1d6ce31cd4c93b34e51ae1de8fb43fc1108 100644 (file)
@@ -1,8 +1,11 @@
-% flags
 %
+% feta-banier.mf -- draw flags
+%
+% source file of the GNU LilyPond music typesetter
+%
+% (c) 1997--2008 Han-Wen Nienhuys <hanwen@xs4all.nl>
 
-
-fet_begingroup ("flags")
+fet_begingroup ("flags");
 
 save outer_path;
 path outer_path;
@@ -25,7 +28,7 @@ right_downflag_space# = .0 downflag_width#;
 % Because of optical illusion, the utmost flag (bottom for
 % down-pointing, top for up-pointing) should be smaller than the other
 % flags.  Adobe Sonata doesn't do this correctly.  (Instead they have
-% an extension flag, which looks less elegant)
+% an extension flag, which looks less elegant.)
 %
 
 save hip_thickness, foot_thickness;
@@ -33,6 +36,8 @@ save hip_thickness, foot_thickness;
 hip_thickness# = 1.0 linethickness# + 0.069 staff_space#;
 foot_thickness# = 1.2055 linethickness# + 0.06 staff_space#;
 
+define_pixels (hip_thickness, foot_thickness);
+
 %
 % Inspired by Adobe Sonata and [Wanske].
 % For example, see POSTSCRIPT Language -- program design,
@@ -50,7 +55,7 @@ def draw_flag (expr center, flare, dims, hip_depth, foot_wid,
        penpos1 (flare, 90);
        penpos2 (whatever, 0);
 
-       x2r - x2l = hip_thickness;
+       x2r - x2l = hround (hip_thickness);
 
        penpos3 (foot_thickness, -20.0);
 
@@ -58,7 +63,12 @@ def draw_flag (expr center, flare, dims, hip_depth, foot_wid,
        z2r = center + (xpart (dims), -ypart (dims) * hip_depth);
        z3r = center + (xpart (dims) * foot_wid, -ypart (dims));
 
-       outer_path := z3r{curl c} .. z2r{up} .. {up}z1r;
+       x2r := hround x2r;
+       y2r := vround y2r;
+
+       outer_path := z3r{curl c}
+                     .. z2r{up}
+                     .. {up}z1r;
 
        if show_labels = 1:
                penlabels (1, 2, 3);
@@ -112,41 +122,43 @@ endgroup
 enddef;
 
 
-fet_beginchar ("8th Flag (up)", "u3")
+fet_beginchar ("8th Flag (up)", "u3");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
 
-       flare# = 1.0 staff_space#;
+       flare = staff_space;
        hip_depth_ratio = .72;
        foot_width_ratio = .8;
        hip_width# = upflag_width# - hip_thickness# / 2;
        foot_depth# = 3 staff_space# - blot_diameter# / 2;
-       define_pixels (flare, hip_width, hip_thickness,
-                      foot_depth, foot_thickness);
+       define_pixels (hip_width, foot_depth);
 
-       set_char_box (0, hip_width# + stemthickness# / 2 + right_upflag_space#,
+       set_char_box (0,
+                     hip_width# + stemthickness# / 2 + right_upflag_space#,
                      foot_depth# + foot_thickness# / 2, stemthickness# / 2);
 
        draw_flag ((0,0), flare, (hip_width, foot_depth),
                   hip_depth_ratio, foot_width_ratio,
                   hip_thickness, foot_thickness, 1);
 
-       draw_square_block ((-.5 stemthickness, -staff_space), (0, 0));
+       draw_square_block ((-0.5 stemthickness_rounded, -staff_space_rounded),
+                          (0, 0));
 fet_endchar;
 
 
-fet_beginchar ("16th Flag (up)", "u4")
+fet_beginchar ("16th Flag (up)", "u4");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
+
        total_depth# = 3.5 staff_space# - blot_diameter# / 2;
        flag_count = 2;
-       flare# = .85 staff_space#;
+       flare = .85 staff_space;
        flagspace# = .85 staff_space#;
        hip_depth_ratio = .72;
        hip_width# = upflag_width# - hip_thickness# / 2;
        flagspace# + foot_depth# = total_depth#;
        foot_width_ratio = .8;
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth,  foot_thickness);
+       define_pixels (hip_width, foot_depth);
+       define_whole_vertical_pixels (flagspace);
 
        set_char_box (0,
                      hip_width# + stemthickness# / 2 + right_upflag_space#,
@@ -159,17 +171,18 @@ fet_beginchar ("16th Flag (up)", "u4")
        add_flag (flagspace, flare, .97, 1.00, 1.25,
                  hip_thickness, foot_thickness);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -2 staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -2 staff_space_rounded));
 fet_endchar;
 
 
-fet_beginchar ("32nd Flag (up)", "u5")
+fet_beginchar ("32nd Flag (up)", "u5");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
 
        flag_count = 3;
        total_depth# = 4.25 staff_space#;
-       flare# = .85 staff_space#;
+       flare = .85 staff_space;
        flagspace# = .87 staff_space#;
        hip_depth_ratio = .72;
        hip_width# = upflag_width# - hip_thickness# / 2;
@@ -177,8 +190,8 @@ fet_beginchar ("32nd Flag (up)", "u5")
 
        (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
 
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth, foot_thickness);
+       define_pixels (hip_width, foot_depth);
+       define_whole_vertical_pixels (flagspace);
 
        set_char_box (0, hip_width# + right_upflag_space#,
                      total_depth# + foot_thickness# / 2, stemthickness# / 2);
@@ -192,16 +205,17 @@ fet_beginchar ("32nd Flag (up)", "u5")
        add_flag (flagspace, flare, .95, 1.05, 1.25,
                  hip_thickness, foot_thickness);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -3 staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -3 staff_space_rounded));
 fet_endchar;
 
 
-fet_beginchar ("64th Flag (up)", "u6")
+fet_beginchar ("64th Flag (up)", "u6");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
 
        flag_count = 4;
-       flare# = .85 staff_space#;
+       flare = .85 staff_space;
        flagspace# = .9 staff_space#;
        hip_depth_ratio = .72;
        hip_width# = upflag_width# - hip_thickness# / 2;
@@ -210,8 +224,8 @@ fet_beginchar ("64th Flag (up)", "u6")
 
        (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
 
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth,  foot_thickness);
+       define_pixels (hip_width, foot_depth);
+       define_whole_vertical_pixels (flagspace);
 
        set_char_box (0, hip_width# + right_upflag_space#,
                      total_depth# + foot_thickness# / 2, stemthickness# / 2);
@@ -228,26 +242,26 @@ fet_beginchar ("64th Flag (up)", "u6")
        add_flag (flagspace, flare, .95, 1.05, 1.25,
                  hip_thickness, foot_thickness);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -4 staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -4 staff_space_rounded));
 fet_endchar;
 
 
-fet_beginchar ("8th (down)", "d3")
+fet_beginchar ("8th (down)", "d3");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
 
        flag_count = 1;
-       flare# = .99 staff_space#;
+       flare = staff_space;
        flagspace# = .9 staff_space#;
-       hip_depth_ratio = .72 ;
+       hip_depth_ratio = .72;
        hip_width# = downflag_width# - hip_thickness# / 2;
        total_depth# = 2.85 staff_space#;
        foot_width_ratio = .8;
 
        (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
 
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth, foot_thickness);
+       define_pixels (hip_width, flagspace, foot_depth);
 
        set_char_box (0, hip_width# + right_downflag_space#,
                      total_depth# + foot_thickness# / 2, stemthickness# / 2)
@@ -257,7 +271,8 @@ fet_beginchar ("8th (down)", "d3")
                   hip_depth_ratio, foot_width_ratio,
                   hip_thickness, foot_thickness, 0);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -staff_space_rounded));
 
        y_mirror_char;
 fet_endchar;
@@ -268,16 +283,15 @@ fet_endchar;
 % Single Stroke for Short Appogiatura
 %
 
-fet_beginchar ("grace dash (up)", "ugrace")
+fet_beginchar ("grace dash (up)", "ugrace");
        save flare, hip_depth_ratio, hip_width, foot_depth;
 
-       flare# = staff_space#;
        hip_depth_ratio = .72;
+       flare# = staff_space#;
        hip_width# = upflag_width# - hip_thickness# / 2;
        foot_depth# = 3 staff_space#;
 
-       define_pixels (flare, hip_width, hip_thickness,
-                      foot_depth, foot_thickness);
+       define_pixels (hip_width, foot_depth);
 
        set_char_box (hip_width# * hip_depth_ratio,
                      hip_width# + right_upflag_space#,
@@ -292,11 +306,11 @@ fet_beginchar ("grace dash (up)", "ugrace")
        penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
 
        fill z1l
-            --- z2l
+            -- z2l
             .. top z2
             .. rt z2
             .. z2r
-            --- z1r
+            -- z1r
             .. bot z1
             .. lft z1
             .. cycle;
@@ -305,20 +319,18 @@ fet_beginchar ("grace dash (up)", "ugrace")
 fet_endchar;
 
 
-fet_beginchar ("grace dash (down)", "dgrace")
+fet_beginchar ("grace dash (down)", "dgrace");
        save flare, hip_depth_ratio, hip_width, foot_depth;
-       save flagspace, total_depth;
+       save total_depth;
 
-       flare# = .99 staff_space#;
-       flagspace# = .9 staff_space#;
        hip_depth_ratio = .72 ;
+       flare# = .99 staff_space#;
        hip_width# = downflag_width# - hip_thickness# / 2;
        total_depth# = 2.85 staff_space#;
        foot_depth# = total_depth#;
        foot_width_ratio = .8;
 
-       define_pixels (flare, hip_width, hip_thickness,
-                      flagspace, foot_depth);
+       define_pixels (hip_width, foot_depth);
 
        set_char_box (hip_width# * hip_depth_ratio,
                      hip_width# + right_downflag_space#,
@@ -333,11 +345,11 @@ fet_beginchar ("grace dash (down)", "dgrace")
        penpos2 (1.5 stemthickness, angle (z2 - z1) - 90);
 
        fill z1l
-            --- z2l
+            -- z2l
             .. top z2
             .. rt z2
             .. z2r
-            --- z1r
+            -- z1r
             .. bot z1
             .. lft z1
             .. cycle;
@@ -346,12 +358,12 @@ fet_beginchar ("grace dash (down)", "dgrace")
 fet_endchar;
 
 
-fet_beginchar ("16th (down)", "d4")
+fet_beginchar ("16th (down)", "d4");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
 
        flag_count = 2;
-       flare# = .8 staff_space#;
+       flare = .8 staff_space;
        flagspace# = .9 staff_space#;
        hip_depth_ratio = .85;
        hip_width# = downflag_width# - hip_thickness# / 2;
@@ -363,8 +375,8 @@ fet_beginchar ("16th (down)", "d4")
        set_char_box (0, hip_width# + right_downflag_space#,
                      total_depth# + foot_thickness# / 2, stemthickness# / 2);
 
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth, foot_thickness);
+       define_pixels (hip_width, foot_depth);
+       define_whole_vertical_pixels (flagspace);
 
        draw_flag ((0, -(flag_count - 1) * flagspace), flare,
                   (hip_width, foot_depth),
@@ -374,18 +386,19 @@ fet_beginchar ("16th (down)", "d4")
        add_flag (flagspace, flare, .95, 1.00, 1.25,
                  hip_thickness, foot_thickness);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -2 staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -2 staff_space_rounded));
 
        y_mirror_char;
 fet_endchar;
 
 
-fet_beginchar ("32nd (down)", "d5")
+fet_beginchar ("32nd (down)", "d5");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
 
        flag_count = 3;
-       flare# = .84 staff_space#;
+       flare = .84 staff_space;
        flagspace# = .9 staff_space#;
        hip_depth_ratio = .85;
        hip_width# = downflag_width# - hip_thickness# / 2;
@@ -394,8 +407,8 @@ fet_beginchar ("32nd (down)", "d5")
 
        (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
 
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth,  foot_thickness);
+       define_pixels (hip_width, foot_depth);
+       define_whole_vertical_pixels (flagspace);
 
        set_char_box (0, hip_width# + right_downflag_space#,
                      total_depth# + foot_thickness# / 2, stemthickness# / 2);
@@ -410,18 +423,19 @@ fet_beginchar ("32nd (down)", "d5")
        add_flag (flagspace, flare, .95, 1.05, 1.25,
                  hip_thickness, foot_thickness);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -3 staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -3 staff_space_rounded));
 
        y_mirror_char;
 fet_endchar;
 
 
-fet_beginchar ("64th (down)", "d6")
+fet_beginchar ("64th (down)", "d6");
        save flare, hip_depth_ratio, hip_width, foot_depth, foot_width_ratio;
        save flagspace, total_depth, flag_count;
 
        flag_count = 4;
-       flare# = .8 staff_space#;
+       flare = .8 staff_space;
        flagspace# = .9 staff_space#;
        hip_depth_ratio = .85;
        hip_width# = downflag_width# - hip_thickness# / 2;
@@ -430,8 +444,8 @@ fet_beginchar ("64th (down)", "d6")
 
        (flag_count - 1) * flagspace# + foot_depth# = total_depth#;
 
-       define_pixels (flare, hip_width, hip_thickness, flagspace,
-                      foot_depth, foot_thickness);
+       define_pixels (hip_width, foot_depth);
+       define_whole_vertical_pixels (flagspace);
 
        set_char_box (0, hip_width# + right_downflag_space#,
                      total_depth# + foot_thickness# / 2, stemthickness# / 2);
@@ -448,7 +462,8 @@ fet_beginchar ("64th (down)", "d6")
        add_flag (.98 flagspace, flare, .91, 1.05, 1.2,
                  hip_thickness, foot_thickness);
 
-       draw_square_block ((-.5 stemthickness, 0), (0, -4 staff_space));
+       draw_square_block ((-0.5 stemthickness_rounded, 0),
+                          (0, -4 staff_space_rounded));
 
        y_mirror_char;
 fet_endchar;