if (!to_boolean (me->get_property ("restore-first"))
&& !parens)
{
- Rational alteration
- = robust_scm2rational (me->get_property ("alteration"), 0);
- if (alteration == FLAT_ALTERATION)
+ SCM alist = me->get_property ("glyph-name-alist");
+ SCM alt = me->get_property ("alteration");
+ string glyph_name = robust_scm2string (ly_assoc_get (alt, alist, SCM_BOOL_F),
+ "");
+
+ if (glyph_name == "accidentals.flat"
+ || glyph_name == "accidentals.mirroredflat")
{
Box stem = b;
Box bulb = b;
we could make the stem thinner, but that places the flats
really close.
*/
- stem[X_AXIS][RIGHT] *= .5;
+ Direction bulb_dir =
+ glyph_name=="accidentals.mirroredflat" ? LEFT : RIGHT;
+ stem[X_AXIS][bulb_dir] = stem[X_AXIS].center ();
/*
To prevent vertical alignment for 6ths
boxes.push_back (bulb);
boxes.push_back (stem);
}
- else if (alteration == NATURAL_ALTERATION)
+ else if (glyph_name == "accidentals.natural")
{
Box lstem = b;
Box rstem = b;
? scm_from_int (0)
: scm_cdar (s);
- SCM glyph_name = ly_assoc_get (alt, alist, SCM_BOOL_F);
- if (!scm_is_string (glyph_name))
+ SCM glyph_name_scm = ly_assoc_get (alt, alist, SCM_BOOL_F);
+ if (!scm_is_string (glyph_name_scm))
{
me->warning (_f ("No glyph found for alteration: %s",
ly_scm2rational (alt).to_string ().c_str ()));
continue;
}
-
- Stencil acc (fm->find_by_name (ly_scm2string (glyph_name)));
+
+ string glyph_name = ly_scm2string (glyph_name_scm);
+
+ Stencil acc (fm->find_by_name (glyph_name));
if (acc.is_empty ())
me->warning (_ ("alteration not found"));
has vertical edges on both sides. A little padding is
needed to prevent collisions.
*/
- Real padding = 0.0;
- if (is_cancellation
+ Real padding = robust_scm2double (me->get_property ("padding"),
+ 0.0);
+ if (glyph_name == "accidentals.natural"
&& last_pos < pos + 2
&& last_pos > pos - 6)
- padding = 0.3;
+ padding += 0.3;
mol.add_at_edge (X_AXIS, LEFT, acc, padding);
last_pos = pos;
"alteration-alist "
"c0-position "
"glyph-name-alist "
+ "padding "
"style "
);