From 8853c06efc7a4f3d7725427da111b6bb802cd7ce Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 21 Mar 2004 00:53:09 +0000 Subject: [PATCH] * lily/staff-symbol.cc (print): span staff-symbol on column extents for non-broken columns. * ly/engraver-init.ly (breakAlignOrder): put staff-bar behind key-signature. * tex/titledefs.tex: don't use smallcaps for piece. --- ChangeLog | 7 +++++ lily/my-lily-lexer.cc | 6 ++--- lily/score-engraver.cc | 8 +++--- lily/staff-symbol.cc | 60 ++++++++++++++++++++++-------------------- ly/engraver-init.ly | 15 +++++++++-- tex/titledefs.tex | 2 +- 6 files changed, 60 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index da4dee423b..bf1d21424c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2004-03-21 Han-Wen Nienhuys + * lily/staff-symbol.cc (print): span staff-symbol on column + extents for non-broken columns. + + * ly/engraver-init.ly (breakAlignOrder): put staff-bar behind key-signature. + + * tex/titledefs.tex: don't use smallcaps for piece. + * lily/system.cc (uniquify_list): bugfix. This fixes spuriously translated stencils in the output. diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 5653b3b989..c36b546c86 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -94,8 +94,6 @@ static Keyword_ent the_key_tab[]={ My_lily_lexer::My_lily_lexer () { - // yy_flex_debug = 1; - keytable_ = new Keyword_table (the_key_tab); chordmodifier_tab_ = scm_make_vector (gh_int2scm (1), SCM_EOL); @@ -163,7 +161,9 @@ My_lily_lexer::lookup_identifier (String s) void My_lily_lexer::start_main_input () -{ +{ + // yy_flex_debug = 1; + new_input (main_input_name_, &global_input_file->sources_); /* Do not allow \include in --safe-mode */ allow_includes_b_ = allow_includes_b_ && ! safe_global_b; diff --git a/lily/score-engraver.cc b/lily/score-engraver.cc index 6fd90611cb..452f40d43b 100644 --- a/lily/score-engraver.cc +++ b/lily/score-engraver.cc @@ -179,13 +179,13 @@ Score_engraver::typeset_all () do { if (!s->get_bound (d)) { - s->set_bound (d, command_column_); + Grob * cc + = unsmob_grob (get_property ("currentCommandColumn")); + s->set_bound (d, cc); /* don't warn for empty/suicided spanners, it makes real warningsinvisible. maybe should be junked earlier? */ - if (!elem->live ()) - ; // gdb hook - else + if (elem->live ()) elem->warning (_f ("unbound spanner `%s'", s->name ().to_str0 ())); } } diff --git a/lily/staff-symbol.cc b/lily/staff-symbol.cc index 45a06981f5..a3b02ef731 100644 --- a/lily/staff-symbol.cc +++ b/lily/staff-symbol.cc @@ -28,7 +28,8 @@ Staff_symbol::print (SCM smob) Grob * common = sp->get_bound (LEFT)->common_refpoint (sp->get_bound (RIGHT), X_AXIS); - Real width = 0.0; + Interval span_points (0,0); + /* For raggedright without ragged staffs, simply set width to the linewidth. @@ -37,30 +38,31 @@ Staff_symbol::print (SCM smob) --hwn. */ - SCM width_scm = me->get_property ("width"); - if (gh_number_p (width_scm)) - { - - /* - don't multiply by Staff_symbol_referencer::staff_space (me), - since that would make aligning staff symbols of different sizes to - one right margin hell. - */ - width = gh_scm2double (width_scm); - } - else + Direction d = LEFT; + do { - width = sp->get_bound (RIGHT)->relative_coordinate (common , X_AXIS); + SCM width_scm = me->get_property ("width"); + if (d == RIGHT && gh_number_p (width_scm)) + { + /* + don't multiply by Staff_symbol_referencer::staff_space (me), + since that would make aligning staff symbols of different sizes to + one right margin hell. + */ + span_points[RIGHT] = gh_scm2double (width_scm); + } + else + { + Item * x = sp->get_bound (d); + + if (x->break_status_dir ()) + span_points[d] = x->relative_coordinate (common , X_AXIS); + else + span_points[d] = x->extent (common, X_AXIS)[d]; + } } + while (flip (&d) !=LEFT); - // respect indentation, if any - width -= sp->get_bound (LEFT)->relative_coordinate (common, X_AXIS); - - if (width < 0) - { - warning (_f ("staff symbol: indentation yields beyond end of line")); - width = 0; - } Real t = me->get_paper ()->get_realvar (ly_symbol2scm ("linethickness")); t *= robust_scm2double (me->get_property ("thickness"), 1.0); @@ -68,16 +70,18 @@ Staff_symbol::print (SCM smob) int l = Staff_symbol::line_count (me); Real height = (l-1) * staff_space (me) /2; + Stencil a = + Lookup::horizontal_line (span_points + -me->relative_coordinate (common, X_AXIS), + t); + Stencil m; for (int i=0; i < l; i++) { - Stencil a = - Lookup::horizontal_line (Interval (0,width), t); - - a.translate_axis (height - i * staff_space (me), Y_AXIS); - m.add_stencil (a); + Stencil b(a); + b.translate_axis (height - i * staff_space (me), Y_AXIS); + m.add_stencil (b); } - return m.smobbed_copy (); } diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index 765abe3616..a680a7bc9a 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -491,15 +491,26 @@ AncientRemoveEmptyStaffContext = \context { (6 . ,DOUBLE-FLAT) (2 . ,DOUBLE-FLAT) (5 . ,DOUBLE-FLAT ) (1 . ,DOUBLE-FLAT) (4 . ,DOUBLE-FLAT) (0 . ,DOUBLE-FLAT) (3 . ,DOUBLE-FLAT) (3 . ,DOUBLE-SHARP) (0 . ,DOUBLE-SHARP) (4 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (5 . ,DOUBLE-SHARP) (2 . ,DOUBLE-SHARP) (6 . ,DOUBLE-SHARP) ) + + %{ + + this order is more complex, see wansek p254 and further. + + for instance, order of clef and :|: depends on function of the clef + + (clef of start-repeat) :|: (change-clef) + + is the proper order. + + %} breakAlignOrder = #'( instrument-name left-edge ambitus breathing-sign clef - rehearsal-mark - staff-bar key-signature + staff-bar time-signature custos ) diff --git a/tex/titledefs.tex b/tex/titledefs.tex index 73e4628d5b..edc1b032a6 100644 --- a/tex/titledefs.tex +++ b/tex/titledefs.tex @@ -94,7 +94,7 @@ \ifx\lilypondpiece\undefined \else - {\flushleft{\large\normalfont\scshape\lilypondpiece} + {\flushleft{\large\normalfont\lilypondpiece} \par} \fi -- 2.39.2