- */
- x_off += sp_iv.length ()/ 2;
-
-
- Molecule s;
- bool rest_symbol=true;
- SCM alt_symbol_sym =get_elt_property ("alt-symbol");
- if (alt_symbol_sym != SCM_UNDEFINED)
- {
- s = lookup_l () -> afm_find (ly_scm2string (alt_symbol_sym));
- rest_symbol = false;
- }
- else if (measures_i_ == 1 || measures_i_ == 2 || measures_i_ == 4)
- {
- s = lookup_l ()->afm_find ("rests-" + to_str (- intlog2(measures_i_)));
- s.translate_axis (-s.extent ()[X_AXIS].length () / 2, X_AXIS);
- }
- else
- {
- String idx = ("rests-") + to_str (-4);
- s = lookup_l ()->afm_find (idx);
- }
-
- mol_p->add_molecule (s);
- Real interline_f = staff_line_leading_f ();
- if (measures_i_ == 1 && rest_symbol)
+ */
+ x_off += sp_iv.length () / 2;
+
+ r.translate_axis (x_off, X_AXIS);
+
+ return r.smobbed_copy ();
+}
+
+MAKE_SCHEME_CALLBACK (Multi_measure_rest, print, 1);
+SCM
+Multi_measure_rest::print (SCM smob)
+{
+ Grob *me = unsmob_grob (smob);
+ Spanner *sp = dynamic_cast<Spanner *> (me);
+
+ Interval sp_iv = bar_width (sp);
+ Real space = sp_iv.length ();
+
+ Real rx = sp->get_bound (LEFT)->relative_coordinate (0, X_AXIS);
+ /*
+ we gotta stay clear of sp_iv, so move a bit to the right if
+ needed.
+ */
+ Real x_off = max (sp_iv[LEFT] - rx, 0.0);
+
+ Stencil mol;
+ mol.add_stencil (symbol_stencil (me, space));
+
+ int measures = 0;
+ SCM m (me->get_property ("measure-count"));
+ if (scm_is_number (m))
+ measures = scm_to_int (m);
+
+ mol.translate_axis (x_off, X_AXIS);
+ return mol.smobbed_copy ();
+}
+
+Stencil
+Multi_measure_rest::symbol_stencil (Grob *me, Real space)
+{
+ int measures = 0;
+ SCM m (me->get_property ("measure-count"));
+ if (scm_is_number (m))
+ measures = scm_to_int (m);
+ if (measures <= 0)
+ return Stencil ();
+
+ SCM limit = me->get_property ("expand-limit");
+ if (measures > scm_to_int (limit))