From 3fd1103f83c1069b04b8c62b978aef65247bd4d2 Mon Sep 17 00:00:00 2001 From: hanwen Date: Tue, 30 Sep 2003 12:00:30 +0000 Subject: [PATCH] * mf/feta-bolletjes.mf: make hole in half note little smaller for stem attachment. * lily/stem.cc (brew_molecule): tweaks for new flag layout. * mf/feta-banier.mf: don't draw stem with flag, just small square attachment. * mf/feta-bolletjes.mf (slash_slope): remove ledger ending * mf/feta-banier.mf: remove upstem/downstem characters. * mf/feta-params.mf (stafflines): stems are 1.3 SLT. * ly/params-init.ly (blotdiameter): set blotdiameter to 2/3 of stafflinethickness (in the default) * lily/stem.cc (brew_molecule): use round_filled_box for stem. * lily/stem.cc: remove #'up-to-staff ; use #'stem-end-position for forcing up to staff. remove #'support-head property (brew_molecule): small cleanup. (flag): remove #'grace property. --- ChangeLog | 14 +++++ lily/stem.cc | 40 ++++++++------ ly/params-init.ly | 4 +- mf/feta-banier.mf | 123 +++++++++++++++++++------------------------ mf/feta-bolletjes.mf | 33 ++++++------ mf/feta-generic.mf | 6 +-- mf/feta-macros.mf | 14 ++++- mf/feta-params.mf | 4 +- 8 files changed, 130 insertions(+), 108 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8267371e92..87ffc22585 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,19 @@ 2003-09-30 Han-Wen Nienhuys + * mf/feta-bolletjes.mf: make hole in half note little + smaller for stem attachment. + + * lily/stem.cc (brew_molecule): tweaks for new flag layout. + + * mf/feta-banier.mf: don't draw stem with flag, just small square + attachment. + + * mf/feta-bolletjes.mf (slash_slope): remove ledger ending + + * mf/feta-banier.mf: remove upstem/downstem characters. + + * mf/feta-params.mf (stafflines): stems are 1.3 SLT. + * ly/params-init.ly (blotdiameter): set blotdiameter to 2/3 of stafflinethickness (in the default) diff --git a/lily/stem.cc b/lily/stem.cc index e3740bf96d..eaedf13ec8 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -674,13 +674,16 @@ Stem::dim_callback (SCM e, SCM ax) { Axis a = (Axis) gh_scm2int (ax); assert (a == X_AXIS); - Grob *se = unsmob_grob (e); + Grob *me = unsmob_grob (e); Interval r (0, 0); - if (unsmob_grob (se->get_grob_property ("beam")) || abs (duration_log (se)) <= 2) + if (unsmob_grob (me->get_grob_property ("beam")) || abs (duration_log (me)) <= 2) ; // TODO! else { - r = flag (se).extent (X_AXIS); + r = flag (me).extent (X_AXIS) + + + gh_scm2double (me->get_grob_property ("thickness")) + * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness"))/2; } return ly_interval2scm (r); } @@ -708,12 +711,17 @@ Stem::brew_molecule (SCM smob) if (!lh) return SCM_EOL; + + if (invisible_b (me)) + { + return SCM_EOL; + } Real y1 = Staff_symbol_referencer::get_position (lh); Real y2 = stem_end_position (me); Interval stem_y (y1 ? y1); - + // dy? Real dy = Staff_symbol_referencer::staff_space (me) * 0.5; @@ -729,25 +737,25 @@ Stem::brew_molecule (SCM smob) y_attach = head_height.linear_combination (y_attach); stem_y[Direction (-d)] += d * y_attach/dy; } + - if (!invisible_b (me)) - { - Real stem_width = gh_scm2double (me->get_grob_property ("thickness")) - // URG - * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); - Real blot = + // URG + Real stem_width = gh_scm2double (me->get_grob_property ("thickness")) + * me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); + Real blot = me->get_paper ()->get_realvar (ly_symbol2scm ("blotdiameter")); - Box b = Box (Interval (-stem_width/2, stem_width/2), - Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)); + + Box b = Box (Interval (-stem_width/2, stem_width/2), + Interval (stem_y[DOWN]*dy, stem_y[UP]*dy)); - Molecule ss = Lookup::round_filled_box (b, blot); - mol.add_molecule (ss); - } + Molecule ss = Lookup::round_filled_box (b, blot); + mol.add_molecule (ss); if (!get_beam (me) && abs (duration_log (me)) > 2) { Molecule fl = flag (me); - fl.translate_axis (stem_y[d]*dy, Y_AXIS); + fl.translate_axis (stem_y[d]*dy - d * blot/2, Y_AXIS); + fl.translate_axis (stem_width/2, X_AXIS); mol.add_molecule (fl); } diff --git a/ly/params-init.ly b/ly/params-init.ly index c38b63d05a..23990bdb5c 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -23,11 +23,9 @@ linethickness = #(/ staffspace 10.0) outputscale = #(/ staffheight 4.0) ledgerlinethickness = #(* 2.0 linethickness) - - % 2/3 stafflinethickness in 20pt staffheight % this parameter is independent of the output size. -blotdiameter = 0.33 \pt +blotdiameter = 0.45 \pt interscoreline = 4. \mm diff --git a/mf/feta-banier.mf b/mf/feta-banier.mf index d07af06854..206cf20d84 100644 --- a/mf/feta-banier.mf +++ b/mf/feta-banier.mf @@ -106,20 +106,20 @@ fet_beginchar("8th Flag (up)", "u3", "eighthflag") foot_width_ratio = .8; hip_width# = upflag_width# - hip_thickness#/2; - foot_depth# = 3 staff_space#; + foot_depth# = 3 staff_space# - blot_diameter#/2; - set_char_box(stemthickness# /2, hip_width# + set_char_box(0, hip_width# + stemthickness#/2 + right_upflag_space#, foot_depth# + foot_thickness#/2, stemthickness#/2) define_pixels(flare, hip_width, hip_thickness, foot_depth, foot_thickness); - draw_flag((stemthickness/2,0), flare, + draw_flag((0,0), flare, (hip_width, foot_depth), hip_depth_ratio, foot_width_ratio, hip_thickness, foot_thickness); - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-1 staff_space); + draw_square_block ((-.5 stemthickness,-1 staff_space), + (0, 0)); fet_endchar; fet_beginchar("16th Flag (up)", "u4", "sixteenthflag") @@ -127,7 +127,7 @@ fet_beginchar("16th Flag (up)", "u4", "sixteenthflag") hip_depth_ratio, hip_width, foot_depth, foot_width_ratio; save flagspace, total_depth, flag_count; - total_depth# = 3.5 staff_space#; + total_depth# = 3.5 staff_space# - blot_diameter# /2 ; flag_count = 2; flare# = .85 staff_space#; flagspace# = .85 staff_space#; @@ -137,14 +137,14 @@ fet_beginchar("16th Flag (up)", "u4", "sixteenthflag") foot_width_ratio = .8; - set_char_box(stemthickness# /2, hip_width# + set_char_box(0, hip_width# + stemthickness#/2 + right_upflag_space#, total_depth# + foot_thickness#/2, stemthickness#/2) define_pixels(flare, hip_width, hip_thickness, flagspace, foot_depth, foot_thickness); - draw_flag((stemthickness/2,- flagspace), flare, + draw_flag((0, - flagspace ), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); @@ -152,7 +152,9 @@ fet_beginchar("16th Flag (up)", "u4", "sixteenthflag") .97, 1.00, 1.25, hip_thickness, foot_thickness); pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); + + draw_square_block ((-.5 stemthickness,0), + (0, -2 staff_space)); fet_endchar; @@ -171,15 +173,15 @@ fet_beginchar("32nd Flag (up)", "u5", "thirtysecondflag") foot_width_ratio = .8; - set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_upflag_space#, + set_char_box(0, hip_width# + + right_upflag_space#, total_depth# + foot_thickness#/2, stemthickness#/2) define_pixels(flare, hip_width, hip_thickness, flagspace, foot_depth, foot_thickness); - draw_flag((stemthickness/2,- 2 flagspace), flare, + draw_flag((0,- 2 flagspace), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); @@ -189,8 +191,10 @@ fet_beginchar("32nd Flag (up)", "u5", "thirtysecondflag") add_flag(flagspace, flare, .95, 1.05, 1.25, hip_thickness, foot_thickness); - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); + + + draw_square_block ((-.5 stemthickness,0), + (0, -3 staff_space)); fet_endchar; fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag") @@ -209,15 +213,15 @@ fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag") foot_width_ratio = .8; - set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_upflag_space#, + set_char_box(0, hip_width# + + right_upflag_space#, total_depth# + foot_thickness#/2, stemthickness#/2) define_pixels(flare, hip_width, hip_thickness, flagspace, foot_depth, foot_thickness); - draw_flag((stemthickness/2,- (flag_count-1)* flagspace), flare, + draw_flag((0,- (flag_count-1)* flagspace), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); @@ -228,8 +232,9 @@ fet_beginchar("64th Flag (up)", "u6", "sixtyfourthflag") 1.00, 1.00, 1.25, hip_thickness, foot_thickness); add_flag(flagspace, flare, .95, 1.05, 1.25, hip_thickness, foot_thickness); - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); + + draw_square_block ((-.5 stemthickness,0), + (0, -4 staff_space)); fet_endchar; fet_beginchar("8th (down)", "d3", "deighthflag") @@ -248,20 +253,20 @@ fet_beginchar("8th (down)", "d3", "deighthflag") foot_width_ratio = .8; - set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_downflag_space#, + 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); - draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, + draw_flag((0,- (flag_count-1) *flagspace), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); + draw_square_block ((-.5 stemthickness,0), + (0, - staff_space)); - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); y_mirror_char; fet_endchar; @@ -289,12 +294,13 @@ fet_beginchar("grace dash (up)", "ugrace", "gracedash") foot_depth, foot_thickness); set_char_box(hip_width# * hip_depth_ratio, - hip_width# + stemthickness#/2 + right_upflag_space#, + hip_width# + right_upflag_space#, foot_depth# * hip_depth_ratio, -flare#) - pickup pencircle scaled 1.5 stemthickness; - draw (-b ,-d) .. - (w, h); + pickup pencircle scaled 1.5 stemthickness; + draw (-b ,-d) .. + (w, h); + fet_endchar; fet_beginchar("grace dash (down)", "dgrace", "dgracedash") @@ -315,11 +321,12 @@ fet_beginchar("grace dash (down)", "dgrace", "dgracedash") flagspace, foot_depth); set_char_box(hip_width# * hip_depth_ratio, - hip_width# + stemthickness#/2 + right_downflag_space#, + hip_width# + right_downflag_space#, foot_depth# * hip_depth_ratio, -flare#) - pickup pencircle scaled 1.5 stemthickness; - draw (-b, -d) .. (w,h); + pickup pencircle scaled 1.5 stemthickness; + draw (-b ,-d) .. + (w, h); y_mirror_char; fet_endchar; @@ -334,29 +341,30 @@ fet_beginchar("16th (down)", "d4", "dsixteenthflag") flagspace# = .9 staff_space#; hip_depth_ratio = .85 ; hip_width# = downflag_width# - hip_thickness#/2; - total_depth# = 3.0 staff_space#; + total_depth# = 3.0 staff_space# - blot_diameter# /2; (flag_count-1) * flagspace# + foot_depth# = total_depth#; foot_width_ratio = .95; - set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_downflag_space#, + 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); - draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, + draw_flag((0,- (flag_count-1) *flagspace), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); add_flag(flagspace, flare, .95, 1.00, 1.25, hip_thickness, foot_thickness); + draw_square_block ((-.5 stemthickness,0), + (0, - 2 staff_space)); + - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); y_mirror_char; fet_endchar; @@ -376,15 +384,15 @@ fet_beginchar("32nd (down)", "d5", "dthirtysecondflag") foot_width_ratio = .95; - set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_downflag_space#, + 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); - draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, + draw_flag((0,- (flag_count-1) *flagspace), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); add_flag(flagspace, flare, @@ -392,11 +400,10 @@ fet_beginchar("32nd (down)", "d5", "dthirtysecondflag") add_flag(flagspace, flare, .95, 1.05, 1.25, hip_thickness, foot_thickness); + draw_square_block ((-.5 stemthickness,0), + (0, - 3 staff_space)); - - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); y_mirror_char; fet_endchar; fet_beginchar("64th (down)", "d6", "dsixtyfourthflag") @@ -415,15 +422,15 @@ fet_beginchar("64th (down)", "d6", "dsixtyfourthflag") foot_width_ratio = .98; - set_char_box(stemthickness# /2, hip_width# - + stemthickness#/2 + right_downflag_space#, + 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); - draw_flag((stemthickness/2,- (flag_count-1) *flagspace), flare, + draw_flag((0,- (flag_count-1) *flagspace), flare, (hip_width, foot_depth), hip_depth_ratio,foot_width_ratio, hip_thickness, foot_thickness); add_flag(flagspace, flare, @@ -434,32 +441,12 @@ fet_beginchar("64th (down)", "d6", "dsixtyfourthflag") add_flag(.98 flagspace, flare, .91, 1.05, 1.2, hip_thickness, foot_thickness); - + draw_square_block ((-.5 stemthickness,0), + (0, - 4 staff_space)); - pickup pencircle scaled stemthickness; - draw (0, 0) .. (0,-2 staff_space); y_mirror_char; fet_endchar; -% ustem? -% -% -% Stem characters so we can compose metronome markings with Feta -% entirely. -% - -fet_beginchar("stem (up)", "stem", "stem") - set_char_box(stemthickness#/2, stemthickness#/2, 0, 3.5staff_space#); - pickup pencircle scaled stemthickness; - draw (0, 0.2staff_space) .. (0, 3.5staff_space); -fet_endchar; - -% do we want this? -fet_beginchar("stem (down)", "dstem", "dstem") - set_char_box(stemthickness#/2, stemthickness#/2, 3.5staff_space#, 0); - pickup pencircle scaled stemthickness; - draw (0, -0.2staff_space) .. (0, -3.5staff_space); -fet_endchar; fet_endgroup("flags"); diff --git a/mf/feta-bolletjes.mf b/mf/feta-bolletjes.mf index 92b298055a..1d6e27ce44 100644 --- a/mf/feta-bolletjes.mf +++ b/mf/feta-bolletjes.mf @@ -65,8 +65,15 @@ else: white:=white rotated inner_tilt; white:=white shifted (w/2,0); fi + + if test = 1: + pickup pencircle scaled 1; + draw black; + draw white; + else: fill black; unfill white; + fi enddef; @@ -145,9 +152,11 @@ fet_beginchar("Half notehead", "1", % superness:=0.66; superness:=0.67; % jcn % ai_a:=0.863; - ai_a:=0.850; % jcn + % was 0.85 + % set to 0.83 to avoid stem entering white part. + ai_a:=0.830; % ai_bi:=3.14; - ai_bi:=3.30; % jcn + ai_bi:=3.25; err_y_ai:=0; err_x_bi:=-0.12; inner_tilt:=tilt; @@ -158,6 +167,13 @@ fet_beginchar("Half notehead", "1", notehead_calc; half_notehead_width# := wd#; notehead_draw; + + define_pixels (wd); + if test = 1: + pickup penrazor scaled stemthickness; + draw (.5 stemthickness, -2 staff_space) .. + (.5 stemthickness, - wd * (ypart dir (inner_tilt - 10)) /2); + fi; fet_endchar; @@ -478,19 +494,6 @@ fet_beginchar("X-Circled notehead", "2xcircle", "xcircledhead") fet_endchar; -%%%%%%%%%%%% -% -% -% ledger (leger) lines -% -fet_beginchar("Ledger ending", "ledgerending", "ledgerending") -set_char_box (5/2 ledgerlinethickness#, 5/2 ledgerlinethickness#, - ledgerlinethickness#/2,ledgerlinethickness#/2); - - - draw_rounded_block((-b,-d),(w,h), 0.8 ledgerlinethickness); -fet_endchar; - fet_endgroup("noteheads"); define_pixels(black_notehead_width); diff --git a/mf/feta-generic.mf b/mf/feta-generic.mf index 0270ad3803..0249176f87 100644 --- a/mf/feta-generic.mf +++ b/mf/feta-generic.mf @@ -39,11 +39,11 @@ if test = 0: input feta-solfa; else: -% input feta-bolletjes; -% input feta-banier; + input feta-bolletjes; + input feta-banier; % input feta-eindelijk; % input feta-klef; - input feta-toevallig; +% input feta-toevallig; % input feta-schrift; % input feta-haak; % input feta-timesig; diff --git a/mf/feta-macros.mf b/mf/feta-macros.mf index a224abb331..a39c3a1fd7 100644 --- a/mf/feta-macros.mf +++ b/mf/feta-macros.mf @@ -158,7 +158,19 @@ def draw_rounded_block (expr bottom_left, top_right, roundness) = def draw_block (expr bottom_left, top_right) = draw_rounded_block (bottom_left, top_right, blot_diameter); enddef; - + + def draw_square_block (expr bottom_left, top_right) = + save x,y; + x1 = xpart bottom_left; + y1 = ypart bottom_left; + x2 = xpart top_right; + y2 = ypart top_right; + + + fill (x1,y1) --- (x2,y1) --- (x2,y2) --- (x1,y2) --- cycle; + enddef; + + def draw_gridline (expr bottom_left,top_right,thickness) = draw_rounded_block (bottom_left-(thickness/2,thickness/2), top_right+(thickness/2,thickness/2), diff --git a/mf/feta-params.mf b/mf/feta-params.mf index 2f793da494..d57d5c3721 100644 --- a/mf/feta-params.mf +++ b/mf/feta-params.mf @@ -16,7 +16,7 @@ staff_space#:=staffsize#/(stafflines-1); % these dimensions should be independent. stafflinethickness#:=0.1 staff_space#; -stemthickness# := stafflinethickness#; +stemthickness# := 1.3 stafflinethickness#; ledgerlinethickness# := 2 stafflinethickness#; define_pixels(staff_space, stemthickness); @@ -41,7 +41,7 @@ overdone_heads = 0.0; % FIXME: According to [Wanske], only outside corners should be round % I don't think we do this anywhere -- jcn numeric blot_diameter; -blot_diameter# = .45pt#; +blot_diameter# = .35 pt#; if (blot_diameter# * hppp) < 1: blot_diameter# := 1/hppp; fi -- 2.39.5