/*
This file is part of LilyPond, the GNU music typesetter.
- Copyright (C) 1997--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
LilyPond is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Real ss = Staff_symbol_referencer::staff_space (me);
bool position_override = scm_is_number (me->get_property ("staff-position"));
- Real amount = robust_scm2double (me->get_property ("staff-position"), 0)
- * 0.5 * ss;
+ Real amount;
- if (line_count % 2)
+ if (position_override)
{
- if (duration_log == 0 && line_count > 1)
- amount += ss;
+ amount =
+ robust_scm2double (me->get_property ("staff-position"), 0) * 0.5 * ss;
+ /*
+ trust the client on good positioning;
+ would be tempting to adjust position of rests longer than a quarter
+ to be properly aligned to staff lines,
+ but custom rest shapes may not need that sort of care.
+ */
}
else
- amount += ss / 2;
+ {
+ amount = 2 * ss * get_grob_direction (me);
- if (!position_override)
- amount += 2 * ss * get_grob_direction (me);;
+ if (line_count % 2 == 0)
+ amount += ss / 2;
+ }
+
+ /*
+ make a semibreve rest hang from the next line,
+ except for a single line staff
+ */
+ if (duration_log == 0 && line_count > 1)
+ amount += ss;
return scm_from_double (amount);
}
int balltype = scm_to_int (balltype_scm);
- string style;
- SCM style_scm = me->get_property ("style");
- if (scm_is_symbol (style_scm))
- style = ly_scm2string (scm_symbol_to_string (style_scm));
+ string style = robust_symbol2string (me->get_property ("style"), "default");
Font_metric *fm = Font_interface::get_default_font (me);
string font_char = glyph_name (me, balltype, style, ledgered);