- 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();
- }
+ String style;
+ SCM style_scm = me->get_property ("style");
+ if (scm_is_symbol (style_scm))
+ style = ly_scm2string (scm_symbol_to_string (style_scm));
+
+ Font_metric *fm = Font_interface::get_default_font (me);
+ String font_char = glyph_name (me, balltype, style, ledgered);
+ Stencil out = fm->find_by_name (font_char);
+ if (out.is_empty ())
+ me->warning (_f ("rest `%s' not found", font_char.to_str0 ()));
+
+ return out.smobbed_copy ();