From 2210b90dc27efb3abd756dfccd9048785130ad4a Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 31 Mar 2002 23:12:19 +0000 Subject: [PATCH] '' --- ChangeLog | 9 +++++++-- Documentation/regression-test.tely | 1 + input/regression/number-staff-lines.ly | 2 +- input/regression/staff-tweak.ly | 20 ++++++++++++++++++++ lily/bar-line.cc | 2 +- lily/beam.cc | 8 ++++---- lily/hairpin.cc | 2 +- lily/hyphen-spanner.cc | 2 +- lily/line-spanner.cc | 2 +- lily/lyric-extender.cc | 2 +- lily/multi-measure-rest.cc | 6 +++--- lily/porrectus.cc | 2 +- lily/slur.cc | 4 ++-- lily/staff-symbol.cc | 13 +++++++++---- lily/stem-engraver.cc | 6 ++++++ lily/stem.cc | 4 ++-- lily/system-start-delimiter.cc | 2 +- lily/text-spanner.cc | 4 ++-- lily/tie.cc | 2 +- lily/tuplet-bracket.cc | 13 +------------ lily/volta-bracket.cc | 2 +- ly/params-init.ly | 4 ++-- scm/grob-description.scm | 1 - scm/grob-property-description.scm | 1 - 24 files changed, 69 insertions(+), 45 deletions(-) create mode 100644 input/regression/staff-tweak.ly diff --git a/ChangeLog b/ChangeLog index bb2b4ee7c9..0a6ac8c554 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2002-04-01 Han-Wen + + * lily/staff-symbol.cc (brew_molecule): make line thickness + adjustable. + + * lily/*.cc: replace stafflinethickness by linethickness. + 2002-04-01 Jan Nieuwenhuizen * input/regression/beam-concave.ly: Add to-be-considered-concave @@ -12,8 +19,6 @@ * scm/grob-property-description.scm (concaveness-gap): Add description. -2002-03-31 Jan Nieuwenhuizen - * input/mozart-hrn3-allegro.ly: Fix typo. 2002-03-31 Juergen Reuter diff --git a/Documentation/regression-test.tely b/Documentation/regression-test.tely index 141cbd18b5..588ea303b6 100644 --- a/Documentation/regression-test.tely +++ b/Documentation/regression-test.tely @@ -237,6 +237,7 @@ Grace note do weird things with timing. Fragile. @lilypondfile[printfilename]{number-staff-lines.ly} +@lilypondfile[printfilename]{staff-tweak.ly} @section Spacing diff --git a/input/regression/number-staff-lines.ly b/input/regression/number-staff-lines.ly index e522311a04..fdcc7e5cf6 100644 --- a/input/regression/number-staff-lines.ly +++ b/input/regression/number-staff-lines.ly @@ -8,7 +8,7 @@ adjusted. " \score { \context Voice \notes\relative c { - c' c c c | g' g g g + c' c c c | g' g g g \bar ":|" } \paper { diff --git a/input/regression/staff-tweak.ly b/input/regression/staff-tweak.ly new file mode 100644 index 0000000000..18db69d0e1 --- /dev/null +++ b/input/regression/staff-tweak.ly @@ -0,0 +1,20 @@ +\header { +texidoc = "The staff is a grob, and may be adjusted as well: this one + shows a staff with 6 thick line, and a slightly large staffspace. +Beams remain correctly quantized. + +" +} + +\score { \notes { + \property Score.StaffSymbol \set #'thickness = #2.0 + \property Score.StaffSymbol \set #'line-count = #6 + \property Score.StaffSymbol \set #'staff-space = #1.1 + c'4 g'4 b'8 b'8 b'8 b'8 +} + +\paper { linewidth = -1. + + + } + } diff --git a/lily/bar-line.cc b/lily/bar-line.cc index d4228dcc25..61a1095250 100644 --- a/lily/bar-line.cc +++ b/lily/bar-line.cc @@ -52,7 +52,7 @@ Bar_line::compound_barline (Grob*me, String str, Real h) Real hair = gh_scm2double (me->get_grob_property ("hair-thickness")); Real fatline = gh_scm2double (me->get_grob_property ("thick-thickness")); - Real staffline = me->paper_l ()->get_var ("stafflinethickness"); + Real staffline = me->paper_l ()->get_var ("linethickness"); Real staff_space = Staff_symbol_referencer::staff_space (me); kern *= staffline; diff --git a/lily/beam.cc b/lily/beam.cc index 16f427bbf3..11fe157c58 100644 --- a/lily/beam.cc +++ b/lily/beam.cc @@ -74,7 +74,7 @@ Beam::add_stem (Grob *me, Grob *s) Real Beam::get_interbeam (Grob *me) { - Real slt = me->paper_l ()->get_var ("stafflinethickness"); + Real slt = me->paper_l ()->get_var ("linethickness"); Real ss = Staff_symbol_referencer::staff_space (me); Real thickness = gh_scm2double (me->get_grob_property ("thickness")) * ss; @@ -378,7 +378,7 @@ Beam::quanting (SCM smob) Real ss = Staff_symbol_referencer::staff_space (me); Real thickness = gh_scm2double (me->get_grob_property ("thickness")) / ss; - Real slt = me->paper_l ()->get_var ("stafflinethickness") / ss; + Real slt = me->paper_l ()->get_var ("linethickness") / ss; SCM sdy = me->get_grob_property ("least-squares-dy"); @@ -1064,7 +1064,7 @@ Beam::stem_beams (Grob *me, Item *here, Item *next, Item *prev, Real dydx) - prev->relative_coordinate (0, X_AXIS); Real stem_w = gh_scm2double (prev->get_grob_property ("thickness")) // URG - * me->paper_l ()->get_var ("stafflinethickness"); + * me->paper_l ()->get_var ("linethickness"); w = w/2 get_grob_property ("thickness")) // URG - * me->paper_l ()->get_var ("stafflinethickness"); + * me->paper_l ()->get_var ("linethickness"); Molecule a = Lookup::beam (dydx, w + stem_w, thick); a.translate_axis (- stem_w/2, X_AXIS); diff --git a/lily/hairpin.cc b/lily/hairpin.cc index f1c715d602..0a45b6a184 100644 --- a/lily/hairpin.cc +++ b/lily/hairpin.cc @@ -23,7 +23,7 @@ Hairpin::brew_molecule (SCM smob) Grob *me= unsmob_grob (smob); Spanner *spanner = dynamic_cast (me); - Real line = me->paper_l ()->get_var ("stafflinethickness"); + Real line = me->paper_l ()->get_var ("linethickness"); SCM s = me->get_grob_property ("grow-direction"); if (!ly_dir_p (s)) diff --git a/lily/hyphen-spanner.cc b/lily/hyphen-spanner.cc index ce66513274..8231c4b2a6 100644 --- a/lily/hyphen-spanner.cc +++ b/lily/hyphen-spanner.cc @@ -45,7 +45,7 @@ Hyphen_spanner::brew_molecule (SCM smob) } while (flip (&d) != LEFT); - Real lt = sp->paper_l ()->get_var ("stafflinethickness"); + Real lt = sp->paper_l ()->get_var ("linethickness"); Real th = gh_scm2double (sp->get_grob_property ("thickness")) * lt ; Real h = gh_scm2double (sp->get_grob_property ("height")); diff --git a/lily/line-spanner.cc b/lily/line-spanner.cc index 3b7c1495b3..5ba97cf8e3 100644 --- a/lily/line-spanner.cc +++ b/lily/line-spanner.cc @@ -244,7 +244,7 @@ Line_spanner::brew_molecule (SCM smob) } - Real thick = me->paper_l ()->get_var ("stafflinethickness"); + Real thick = me->paper_l ()->get_var ("linethickness"); SCM s = me->get_grob_property ("thickness"); if (gh_number_p (s)) diff --git a/lily/lyric-extender.cc b/lily/lyric-extender.cc index 38c44068cd..0c7bb4ec44 100644 --- a/lily/lyric-extender.cc +++ b/lily/lyric-extender.cc @@ -26,7 +26,7 @@ Lyric_extender::brew_molecule (SCM smob) Real leftext = sp->get_bound (LEFT)->extent (sp->get_bound (LEFT), X_AXIS).length (); - Real sl = sp->paper_l ()->get_var ("stafflinethickness"); + Real sl = sp->paper_l ()->get_var ("linethickness"); Real righttrim = 0.5; // default to half a space gap on the right SCM righttrim_scm = sp->get_grob_property ("right-trim-amount"); if (gh_number_p (righttrim_scm)) { diff --git a/lily/multi-measure-rest.cc b/lily/multi-measure-rest.cc index 1549cf727c..6a52280949 100644 --- a/lily/multi-measure-rest.cc +++ b/lily/multi-measure-rest.cc @@ -196,7 +196,7 @@ Multi_measure_rest::big_rest (Grob *me, Real width) Real thick = gh_scm2double (me->get_grob_property ("thickness")); Real ss = Staff_symbol_referencer::staff_space (me); - Real slt = me->paper_l ()->get_var ("stafflinethickness"); + Real slt = me->paper_l ()->get_var ("linethickness"); Real y = slt * thick/2 * ss; Box b(Interval (0, width), Interval (-y, y)); Real ythick = slt * ss; @@ -301,7 +301,7 @@ Multi_measure_rest::set_spacing_rods (SCM smob) Item * rb = r->find_prebroken_piece (LEFT); Item* combinations[4][2]={{l,r}, {lb,r}, {l,rb},{lb,rb}}; - Real staff_space = Staff_symbol_referencer::staff_space (me); + for (int i=0; i < 4; i++) { Item * l = combinations[i][0]; @@ -314,7 +314,7 @@ Multi_measure_rest::set_spacing_rods (SCM smob) rod.item_l_drul_[LEFT] = l; rod.item_l_drul_[RIGHT] = r; rod.distance_f_ = l->extent (l, X_AXIS)[BIGGER] - r->extent (r, X_AXIS)[SMALLER] - + 4.0; // magic! + + 5.0; // magic! rod.add_to_cols (); } diff --git a/lily/porrectus.cc b/lily/porrectus.cc index 405a567d17..c9865f68b2 100644 --- a/lily/porrectus.cc +++ b/lily/porrectus.cc @@ -182,7 +182,7 @@ Porrectus::brew_molecule (SCM smob) line_thickness = 1.0; } Real thickness = - line_thickness * me->paper_l ()->get_var ("stafflinethickness"); + line_thickness * me->paper_l ()->get_var ("linethickness"); SCM porrectus_width_scm = me->get_grob_property ("width"); Real porrectus_width; diff --git a/lily/slur.cc b/lily/slur.cc index dcdea460ab..0678e694fc 100644 --- a/lily/slur.cc +++ b/lily/slur.cc @@ -338,7 +338,7 @@ Slur::get_attachment (Grob *me, Direction dir, */ Real stem_thickness = gh_scm2double (stem->get_grob_property ("thickness")) - * stem->paper_l ()->get_var ("stafflinethickness"); + * stem->paper_l ()->get_var ("linethickness"); o += Offset (0.5 * x_extent * (1 + Stem::get_direction (stem)) - ((dir + 1)/2) * stem_thickness @@ -545,7 +545,7 @@ Slur::brew_molecule (SCM smob) return SCM_EOL; } - Real thick = me->paper_l ()->get_var ("stafflinethickness") * + Real thick = me->paper_l ()->get_var ("linethickness") * gh_scm2double (me->get_grob_property ("thickness")); Bezier one = get_curve (me); diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 4eeb24b864..61b762fe99 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -46,7 +46,11 @@ Staff_symbol::brew_molecule (SCM smob) ; } - Real t = me->paper_l ()->get_var ("stafflinethickness"); + Real t = me->paper_l ()->get_var ("linethickness"); + SCM my_thick = me->get_grob_property("thickness"); + if (gh_number_p(my_thick)) + t *= gh_scm2double (my_thick); + int l = Staff_symbol::line_count (me); Real height = (l-1) * staff_space (me) /2; @@ -100,7 +104,8 @@ Staff_symbol::has_interface (Grob*m) ADD_INTERFACE (Staff_symbol,"staff-symbol-interface", - "This spanner draws the lines of a staff. The middle line is -position 0.", - "staff-space line-count invisible-staff"); + "This spanner draws the lines of a staff. The center (i.e. middle line +or space) is position 0.", + + "staff-space thickness line-count"); diff --git a/lily/stem-engraver.cc b/lily/stem-engraver.cc index c4cab0c3a1..da011fd60e 100644 --- a/lily/stem-engraver.cc +++ b/lily/stem-engraver.cc @@ -149,6 +149,12 @@ Stem_engraver::stop_translation_timestep () aargh: I don't get it. direction is being set (and then set to forced), if we have a Chord_tremolo. */ + + /* + Why the separate check for forced directions? --hwn. + + (docme) + */ SCM dir = stem_p_->get_grob_property ("direction"); if (gh_number_p (dir) && to_dir (dir)) { diff --git a/lily/stem.cc b/lily/stem.cc index 79823a1092..752a0baef2 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -586,7 +586,7 @@ Stem::brew_molecule (SCM smob) { Real stem_width = gh_scm2double (me->get_grob_property ("thickness")) // URG - * me->paper_l ()->get_var ("stafflinethickness"); + * me->paper_l ()->get_var ("linethickness"); Molecule ss =Lookup::filledbox (Box (Interval (-stem_width/2, stem_width/2), Interval (stem_y[DOWN]*dy, stem_y[UP]*dy))); @@ -633,7 +633,7 @@ Stem::off_callback (SCM element_smob, SCM) { Real rule_thick = gh_scm2double (me->get_grob_property ("thickness")) - * me->paper_l ()->get_var ("stafflinethickness"); + * me->paper_l ()->get_var ("linethickness"); r += - d * rule_thick * 0.5; diff --git a/lily/system-start-delimiter.cc b/lily/system-start-delimiter.cc index 5ad1bc6c6e..b07c6619b1 100644 --- a/lily/system-start-delimiter.cc +++ b/lily/system-start-delimiter.cc @@ -67,7 +67,7 @@ System_start_delimiter::has_interface (Grob*me) Molecule System_start_delimiter::simple_bar (Grob*me,Real h) { - Real w = me->paper_l ()->get_var ("stafflinethickness") * + Real w = me->paper_l ()->get_var ("linethickness") * gh_scm2double (me->get_grob_property ("thickness")); return Lookup::filledbox (Box (Interval (0,w), Interval (-h/2, h/2))); } diff --git a/lily/text-spanner.cc b/lily/text-spanner.cc index 0ff02bf2e0..634c517769 100644 --- a/lily/text-spanner.cc +++ b/lily/text-spanner.cc @@ -134,7 +134,7 @@ Text_spanner::brew_molecule (SCM smob) /* ugh */ - Real thick = me->paper_l ()->get_var ("stafflinethickness"); + Real thick = me->paper_l ()->get_var ("linethickness"); SCM st = me->get_grob_property ("thickness"); if (gh_number_p (st)) { @@ -195,7 +195,7 @@ void Text_spanner::setup_pedal_bracket(Spanner *me) { - Real thick = me->paper_l ()->get_var ("stafflinethickness"); + Real thick = me->paper_l ()->get_var ("linethickness"); SCM st = me->get_grob_property ("thickness"); if (gh_number_p (st)) { diff --git a/lily/tie.cc b/lily/tie.cc index 688a12dece..9f116b8f60 100644 --- a/lily/tie.cc +++ b/lily/tie.cc @@ -294,7 +294,7 @@ Tie::brew_molecule (SCM smob) Real thick = gh_scm2double (me->get_grob_property ("thickness")) - * me->paper_l ()->get_var ("stafflinethickness"); + * me->paper_l ()->get_var ("linethickness"); Bezier b; int i = 0; diff --git a/lily/tuplet-bracket.cc b/lily/tuplet-bracket.cc index da4f058540..4b857da02f 100644 --- a/lily/tuplet-bracket.cc +++ b/lily/tuplet-bracket.cc @@ -32,8 +32,6 @@ follow beam precisely for determining tuplet number location. */ - - MAKE_SCHEME_CALLBACK (Tuplet_bracket,brew_molecule,1); SCM Tuplet_bracket::brew_molecule (SCM smob) @@ -101,7 +99,7 @@ Tuplet_bracket::brew_molecule (SCM smob) if (bracket_visibility) { - Real lt = me->paper_l ()->get_var ("stafflinethickness"); + Real lt = me->paper_l ()->get_var ("linethickness"); SCM thick = me->get_grob_property ("thick"); SCM gap = me->get_grob_property ("number-gap"); @@ -260,15 +258,6 @@ Direction Tuplet_bracket::get_default_dir (Grob*me) { Direction d = UP; - SCM dir_sym =me->get_grob_property ("dir-forced"); - if (ly_dir_p (dir_sym)) - { - d= to_dir (dir_sym); - if (d != CENTER) - return d; - } - - d = UP ; for (SCM s = me->get_grob_property ("columns"); gh_pair_p (s); s = ly_cdr (s)) { Grob * nc = unsmob_grob (ly_car (s)); diff --git a/lily/volta-bracket.cc b/lily/volta-bracket.cc index 1705fbf24b..ffe9e5b887 100644 --- a/lily/volta-bracket.cc +++ b/lily/volta-bracket.cc @@ -59,7 +59,7 @@ Volta_bracket_interface::brew_molecule (SCM smob) (strcmp(cs,":|")!=0 && strcmp(cs,"|:")!=0 && strcmp(cs,"|.")!=0 && strcmp(cs,":|:")!=0 && strcmp(cs,".|")!=0); - Real staff_thick = me->paper_l ()->get_var ("stafflinethickness"); + Real staff_thick = me->paper_l ()->get_var ("linethickness"); Real half_space = 0.5; Item * bound = dynamic_cast (me)->get_bound (LEFT); diff --git a/ly/params-init.ly b/ly/params-init.ly index 69c2ea699e..9dd6f2c2f8 100644 --- a/ly/params-init.ly +++ b/ly/params-init.ly @@ -20,9 +20,9 @@ paperfile = \papersize + "-init.ly" unit = "mm" staffspace = \staffheight / 4.0 -stafflinethickness = \staffspace / 10.0 +linethickness = \staffspace / 10.0 outputscale = \staffheight / 4.0 -ledgerlinethickness = 2.0 * \stafflinethickness +ledgerlinethickness = 2.0 * \linethickness diff --git a/scm/grob-description.scm b/scm/grob-description.scm index ab647f4df5..74f73f5061 100644 --- a/scm/grob-description.scm +++ b/scm/grob-description.scm @@ -707,7 +707,6 @@ (StaffSymbol . ( (molecule-callback . ,Staff_symbol::brew_molecule) - (staff-space . 1.0) (line-count . 5) (layer . 0) (meta . ((interfaces . (staff-symbol-interface)))) diff --git a/scm/grob-property-description.scm b/scm/grob-property-description.scm index 055699db66..38a92f16a9 100644 --- a/scm/grob-property-description.scm +++ b/scm/grob-property-description.scm @@ -197,7 +197,6 @@ FIXME: in Tie this is a pair of grob pointers, pointing to the two heads of the (grob-property-description 'ideal-distances list? "(OBJ . (DIST . STRENGTH)) pairs.") (grob-property-description 'interfaces list? "list of symbols indicating the interfaces supported by this object. Is initialized from the @code{meta} field.") (grob-property-description 'inversion list? " musical-pitch, optional.") -(grob-property-description 'invisible-staff boolean? "is staff invisible?") (grob-property-description 'items-worth-living list? "list of interesting items. If empty in a particular system, clear that system.") (grob-property-description 'kern number? "amount of extra white space to add. -- 2.39.2