]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/staff-symbol.cc (print): span staff-symbol on column
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Mar 2004 00:53:09 +0000 (00:53 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 21 Mar 2004 00:53:09 +0000 (00:53 +0000)
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
lily/my-lily-lexer.cc
lily/score-engraver.cc
lily/staff-symbol.cc
ly/engraver-init.ly
tex/titledefs.tex

index da4dee423b52df0f77fd025d493d0cc8769144eb..bf1d21424cd66ae6b0e64bbd61f028ece95dd68f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2004-03-21  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * 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.
 
index 5653b3b989fb1194a046d4eaf44bd1b05bff6e80..c36b546c8640d5c948750e1c4d4727c27bac0236 100644 (file)
@@ -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;
index 6fd90611cb22ada272b43937596c0cfacf3d83a6..452f40d43b66b85a4335c05367771ee51862d802 100644 (file)
@@ -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 ()));
              }
          }
index 45a06981f5e66381c2dfd15e71cda026bc9d3d0e..a3b02ef731b596b748fd74b745d6c38c6ff26f82 100644 (file)
@@ -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 ();
 }
 
index 765abe36164889629a105a8d5530ed5f19a49ae9..a680a7bc9a0b83e04b23368086d69aae78c4df1c 100644 (file)
@@ -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
     )
index 73e4628d5beb4b8faf84eacce709f03c636f88c8..edc1b032a64daed900992cc2013e1c14f8a941d2 100644 (file)
@@ -94,7 +94,7 @@
 
   \ifx\lilypondpiece\undefined
   \else
-    {\flushleft{\large\normalfont\scshape\lilypondpiece}
+    {\flushleft{\large\normalfont\lilypondpiece}
      \par}
   \fi