source file of the GNU LilyPond music typesetter
- (c) 1997--2001 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "molecule.hh"
{
Grob *me = unsmob_grob (smob);
int bt = gh_scm2int (me->get_grob_property ("duration-log"));
- if (bt == 0)
+ if (bt == 0 && Staff_symbol_referencer::line_count (me) > 1)
{
me->translate_axis (Staff_symbol_referencer::staff_space (me) , Y_AXIS);
}
if (d && bt > 4) // UGH.
{
d->set_grob_property ("staff-position",
- gh_int2scm ((bt == 7) ? 4 : 3));
+ gh_int2scm ((bt == 7) ? 4 : 3));
}
return SCM_UNSPECIFIED;
if (balltype == 0 || balltype == 1)
{
Real rad = Staff_symbol_referencer::staff_radius (me) * 2.0;
- Real pos = Staff_symbol_referencer::position_f (me);
+ Real pos = Staff_symbol_referencer::get_position (me);
/*
Figure out when the rest is far enough outside the staff. This
ledger_b = ledger_b || (balltype == 1 &&
(pos <= -rad -2 || pos > rad));
}
-
- return ("rests-") + to_str (balltype)
+
+ return ("rests-") + to_string (balltype)
+ (ledger_b ? "o" : "") + style;
}
SCM balltype_scm = me->get_grob_property ("duration-log");
if (!gh_number_p (balltype_scm))
return Molecule ().smobbed_copy ();
+
int balltype = gh_scm2int (balltype_scm);
String style;
SCM style_sym =me->get_grob_property ("style");
- if (balltype >= 2 && gh_symbol_p (style_sym))
+ if (gh_symbol_p (style_sym))
{
style = ly_scm2string (scm_symbol_to_string (style_sym));
}
- String idx = glyph_name (me, balltype, style);
- return Font_interface::get_default_font (me)->find_by_name (idx).smobbed_copy ();
+ for(;;) {
+ String idx = glyph_name (me, balltype, style);
+ Molecule res = Font_interface::get_default_font (me)->find_by_name (idx);
+ if(res.empty_b() && style!="")
+ style="";
+ else
+ return res.smobbed_copy();
+ }
}
SCM
return ly_interval2scm (unsmob_molecule (m)->extent (a));
}
-bool
-Rest::has_interface (Grob*m)
-{
- return m && m->has_interface (ly_symbol2scm ("rest-interface"));
-}
+
+
+ADD_INTERFACE (Rest,"rest-interface",
+ "a rest",
+ "style minimum-beam-collision-distance");
+