}
SCM log = scm_int2num (Note_head::get_balltype (me));
- SCM proc = me->get_property ("glyph-name-procedure");
-
- String suffix = to_string (robust_scm2int (me->get_property ("duration-log"), 2));
- if (ly_is_procedure (proc))
- suffix = ly_scm2string (scm_call_2 (proc, log, style));
-
- Font_metric *fm = Font_interface::get_default_font (me);
-
- Direction stem_dir = CENTER;
- if (Grob *stem = unsmob_grob (me->get_object ("stem")))
+ String suffix = to_string (min (robust_scm2int (me->get_property ("duration-log"), 2), 2));
+ if (style != ly_symbol2scm ("default"))
{
- stem_dir = get_grob_direction (stem);
- if (stem_dir == CENTER)
- programming_error ("must have stem dir for note head");
- }
+ SCM proc = me->get_property ("glyph-name-procedure");
+ if (ly_is_procedure (proc))
+ suffix = ly_scm2string (scm_call_2 (proc, log, style));
+ }
+ Font_metric *fm = Font_interface::get_default_font (me);
- Stencil out;
+ String idx = "noteheads.s" + suffix;
- String prefix = "noteheads.";
- String idx
- = prefix + ((stem_dir == UP) ? "u" : "d") + suffix;
- out = fm->find_by_name (idx);
+ Stencil out = fm->find_by_name (idx);
if (out.is_empty ())
{
- idx = prefix + "s" + suffix;
+ String prefix = "noteheads.";
+ Grob *stem = unsmob_grob (me->get_object ("stem"));
+ Direction stem_dir = stem ? get_grob_direction (stem) : CENTER;
+
+ if (stem_dir == CENTER)
+ programming_error ("must have stem dir for note head");
+ String idx = prefix + ((stem_dir == UP) ? "u" : "d") + suffix;
out = fm->find_by_name (idx);
}
if (out.is_empty ())
{
me->warning (_f ("note head `%s' not found", idx.to_str0 ()));
+ out = Stencil (Box(Interval (0, 0),Interval (0, 0)), SCM_EOL);
}
else
{