[This is one of three messages that didn't get distributed last night
and today due to problems with the GNU mailing lists - drl]
------------- Begin Forwarded Message -------------
Hi,

I found a couple of new bugs and implemented some new
features. The patch below replaces the patch I sent
for pl 17.

- A G_staff_side_item without an empty support_l_arr_ gives a 
  SIGSEGV on line 75:
  Real off = dim_cache_[Y_AXIS].relative_coordinate (common);

The following example triggers this bug.
----------------------------------
n = \notes {
  c4 c c c | \mark "A";
}

global = \notes {
  s1^"Andante"
}

\score{
          \type Staff < \global \n >
}
--------------------------------

- The direction of textual scripts ('^' or '_') is ignored.


I have changed Mark_engraver to use the G_... classes.
My implementation has the following shortcomings at the
moment.

- markScriptPadding is not supported, since G_staff_side_item does not
  support padding.

- markBreakPriority is not supported. 

- Mostly, you want the marks aligned with the bar lines. I don't 
  really understand how to implement that feature.

- You get lots of warnings about missing 'number' and 'Large'

I have also made a somewhat more sophisticated layout of 
multi-bar rests. A |=====| like rest symbol is used for
except for two-bar and four-bar rests, where the breve
and longa symbols, respectively, are used. 
A desirable future feature would be an optional
style that uses a number of 4,2 and 1-bar symbols
instead of the |====| symbol. 
Note that this patch changes the font.


    /Mats


---------------------------------------
Generated by (address unknown) using package-diff 0.62,
>From = lilypond-1.1.18, To = lilypond-1.1.18.mb1

usage 

    cd lilypond-source-dir; patch -E -p1 < lilypond-1.1.18.mb1.diff

Patches do not contain automatically generated files 
or (urg) empty directories, 
i.e., you should rerun autoconf, configure 
and possibly make outdirs.

--state
1.1.18
1.1.18.mb1
++state
diff -urN ../lilypond-1.1.18/NEWS ./NEWS
--- ../lilypond-1.1.18/NEWS     Mon Jan  4 10:25:45 1999
+++ ./NEWS      Wed Jan  6 01:43:24 1999
@@ -1,3 +1,8 @@
+pl 18.mb1
+        - \mark now works, using G_staff_side_item.
+       - Improved layout of multi-bar rests, including a new
+         font symbol.
+
 pl 17.jbr2
         - Documentation/README-W32: Brought my stuff up to date
         - Documentation/ntweb: updated for realease
diff -urN ../lilypond-1.1.18/VERSION ./VERSION
--- ../lilypond-1.1.18/VERSION  Mon Jan  4 11:32:59 1999
+++ ./VERSION   Wed Jan  6 01:41:47 1999
@@ -2,7 +2,7 @@
 MAJOR_VERSION=1
 MINOR_VERSION=1
 PATCH_LEVEL=18
-MY_PATCH_LEVEL=
+MY_PATCH_LEVEL=mb1
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
diff -urN ../lilypond-1.1.18/lily/include/mark-engraver.hh 
./lily/include/mark-engraver.hh
--- ../lilypond-1.1.18/lily/include/mark-engraver.hh    Mon Nov 16 15:20:50 1998
+++ ./lily/include/mark-engraver.hh     Tue Jan  5 22:21:59 1999
@@ -12,6 +12,9 @@
 
 #include "engraver.hh"
 
+class G_staff_side_item;
+class G_text_item;
+
 /**
   */
 class Mark_engraver : public Engraver 
@@ -26,10 +29,12 @@
   virtual bool do_try_music (Music *req_l);
   virtual void do_process_requests ();
   virtual void do_pre_move_processing ();
+  virtual void acknowledge_element (Score_element_info);
 
 private:
   Mark_req * mark_req_l_;
-  Script* script_p_;
+  G_staff_side_item* staff_side_p_;
+  G_text_item* text_p_;
 };
 
 #endif // MARK_ENGRAVER_HH
diff -urN ../lilypond-1.1.18/lily/mark-engraver.cc ./lily/mark-engraver.cc
--- ../lilypond-1.1.18/lily/mark-engraver.cc    Mon Jan  4 10:23:12 1999
+++ ./lily/mark-engraver.cc     Wed Jan  6 00:32:33 1999
@@ -13,14 +13,19 @@
 #include "command-request.hh"
 #include "time-description.hh"
 #include "engraver-group.hh"
-
+#include "staff-sym.hh"
+#include "g-text-item.hh"
+#include "g-staff-side.hh"
+#include "stem.hh"
+#include "rhythmic-head.hh"
 
 ADD_THIS_TRANSLATOR (Mark_engraver);
 
 Mark_engraver::Mark_engraver ()
 {
   mark_req_l_ = 0;
-  script_p_ = 0;
+  staff_side_p_ = 0;
+  text_p_ = 0;
 }
 
 bool
@@ -37,47 +42,71 @@
 void
 Mark_engraver::do_process_requests ()
 {  
-  if (!mark_req_l_ || script_p_)
+  if (!mark_req_l_ || staff_side_p_)
     return;
 
-  script_p_ = new Script;
-  script_p_->breakable_b_ = true;
+  staff_side_p_ = new G_staff_side_item;
 
-  Text_def *td_p = new Text_def;
+  text_p_ = new G_text_item;
 
-  td_p->text_str_ = mark_req_l_->str_;
-  td_p->align_dir_ = CENTER;
+  text_p_->text_str_ = mark_req_l_->str_;
+  //  text_p_->align_dir_ = CENTER;
 
-  td_p->style_str_ = td_p->text_str_.index_any_i ("0123456789") >= 0 
+  text_p_->style_str_ = text_p_->text_str_.index_any_i ("0123456789") >= 0 
     ? "mark" : "Large";
 
-  script_p_->dir_ = LEFT;
-  script_p_->specs_p_ = td_p->clone ();
-  script_p_->postbreak_only_b_ = true;
-  
-  Scalar padding = get_property ("markScriptPadding", 0);
-  if (padding.length_i() && padding.isnum_b ())
+  Scalar prop = get_property ("markdir", 0);
+  if (prop.isnum_b ())
     {
-      script_p_->padding_f_ = Real(padding);
+      staff_side_p_->dir_ = (Direction) (int) prop;
     }
-  Scalar break_priority = get_property ("markBreakPriority", 0);
-  if (break_priority.length_i() && break_priority.isnum_b ())
+  else 
     {
-      script_p_->break_priority_i_ = int(break_priority);
+      staff_side_p_->dir_ = UP;
     }
 
+  staff_side_p_->set_victim(text_p_);
   
-  announce_element (Score_element_info (script_p_, mark_req_l_));
+  //  Scalar padding = get_property ("markScriptPadding", 0);
+  //  if (padding.length_i() && padding.isnum_b ())
+  //    {
+  //      script_p_->padding_f_ = Real(padding);
+  //    }
+  //  Scalar break_priority = get_property ("markBreakPriority", 0);
+  //  if (break_priority.length_i() && break_priority.isnum_b ())
+  //    {
+  //      staff_side_p_->break_priority_i_ = int(break_priority);
+  //    }
+
+  
+  announce_element (Score_element_info (text_p_, mark_req_l_));
+  announce_element (Score_element_info (staff_side_p_, mark_req_l_));
 }
 
 void 
 Mark_engraver::do_pre_move_processing ()
 {
-  if (script_p_) 
+  if (staff_side_p_) 
     {
-      typeset_element (script_p_);
-      script_p_ = 0;
+      Staff_symbol* s_l = get_staff_info().staff_sym_l_;
+      staff_side_p_->add_support (s_l);
+      typeset_element (text_p_);
+      typeset_element (staff_side_p_);
+      text_p_ = 0;
+      staff_side_p_ = 0;
       mark_req_l_ = 0;
     }
 }
 
+void
+Mark_engraver::acknowledge_element (Score_element_info i)
+{
+  if (staff_side_p_) 
+    {
+      if (dynamic_cast<Stem *> (i.elem_l_) ||
+         dynamic_cast<Rhythmic_head *> (i.elem_l_))
+       {
+         staff_side_p_->add_support (i.elem_l_);
+       }
+    }
+}
diff -urN ../lilypond-1.1.18/lily/multi-measure-rest.cc ./lily/multi-measure-rest.cc
--- ../lilypond-1.1.18/lily/multi-measure-rest.cc       Mon Jan  4 10:23:12 1999
+++ ./lily/multi-measure-rest.cc        Tue Jan  5 20:05:40 1999
@@ -15,7 +15,7 @@
 #include "script.hh"
 #include "text-def.hh"
 #include "molecule.hh"
-
+#include "misc.hh"
 
 
 Multi_measure_rest::Multi_measure_rest ()
@@ -37,17 +37,28 @@
      * make real multi-measure rest symbol: |---|
      * make two,four,eight-measure-rest symbols
    */
-
-  Atom s (lookup_l ()->rest (0, 0));
+  Atom s;
+  if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4) 
+    {
+      s = (lookup_l ()->rest (- intlog2(measures_i_), 0));
+    }
+  else 
+    {
+      s = (lookup_l ()->rest (-4, 0));
+    }
   Molecule* mol_p = new Molecule ( Atom (s));
   Real interline_f = paper ()->interline_f ();
-  mol_p->translate_axis (interline_f, Y_AXIS);
+  if (measures_i_ == 1)
+    {
+      mol_p->translate_axis (interline_f, Y_AXIS);
+    }
 
   if (measures_i_ > 1)
     {
       Text_def text;
       text.text_str_ = to_str (measures_i_);
       text.style_str_ = "number";
+      text.align_dir_ = CENTER;
       Atom s = text.get_atom (paper (), UP);
       s.translate_axis (3.0 * interline_f, Y_AXIS);
       mol_p->add_atom (s);
diff -urN ../lilypond-1.1.18/mf/feta-eindelijk.mf ./mf/feta-eindelijk.mf
--- ../lilypond-1.1.18/mf/feta-eindelijk.mf     Fri Oct 23 14:23:14 1998
+++ ./mf/feta-eindelijk.mf      Wed Jan  6 00:30:51 1999
@@ -92,8 +92,10 @@
 
 breve_rest_y# =  interline#;
 breve_rest_x# = 3/5 interline#;
+multi_rest_x# = 2 interline#;
+multi_rest_y# = 1/3 interline#;
 
-define_pixels(breve_rest_y, breve_rest_x);
+define_pixels(breve_rest_y, breve_rest_x, multi_rest_x, multi_rest_y);
 
 fet_beginchar("breve rest", "-1", "breverest");
        set_char_box(0, breve_rest_x#, 0, breve_rest_y#);
@@ -105,6 +107,16 @@
        draw_block ((0,-breve_rest_y), (breve_rest_x, breve_rest_y));
 fet_endchar;
 
+fet_beginchar("multi rest", "-4", "multirest");
+       set_char_box(multi_rest_x#, multi_rest_x#,
+                    breve_rest_y#, breve_rest_y#);
+       draw_block ((-multi_rest_x, -multi_rest_y),
+                  (multi_rest_x, multi_rest_y));
+       draw_block ((-multi_rest_x,-breve_rest_y),
+                  (rthin-multi_rest_x, breve_rest_y));
+       draw_block ((multi_rest_x-rthin,-breve_rest_y),
+                  (multi_rest_x, breve_rest_y));
+fet_endchar;
 
 fet_beginchar("Quarter rest","2","quartrest");
        save alpha;
diff -urN ../lilypond-1.1.18/scm/lily.scm ./scm/lily.scm
--- ../lilypond-1.1.18/scm/lily.scm     Mon Jan  4 10:23:13 1999
+++ ./scm/lily.scm      Tue Jan  5 20:38:13 1999
@@ -78,6 +78,9 @@
 (define (settypewriter s) (text "typewriter" s))
 (define (setnumber s) (text "number" s))
 (define (setbold s) (text "bold" s))
+(define (setlarge s) (text "large" s))
+(define (setLarge s) (text "Large" s))
+(define (setmark s) (text "mark" s))
 (define (setfinger s) (text "finger" s))
 (define (setitalic s) (text "italic" s))
 (define (setnumber-1 s) (text "numberj" s))

------------- End Forwarded Message -------------

Reply via email to