- int log = duration_log (me);
- /*
- TODO: maybe property stroke-style should take different values,
- e.g. "" (i.e. no stroke), "single" and "double" (currently, it's
- '() or "grace"). */
- string flag_style;
-
- SCM flag_style_scm = me->get_property ("flag-style");
- if (scm_is_symbol (flag_style_scm))
- flag_style = ly_symbol2string (flag_style_scm);
-
- if (flag_style == "no-flag")
- return Stencil ().smobbed_copy ();
-
- bool adjust = true;
-
- string staffline_offs;
- if (flag_style == "mensural")
- /* Mensural notation: For notes on staff lines, use different
- flags than for notes between staff lines. The idea is that
- flags are always vertically aligned with the staff lines,
- regardless if the note head is on a staff line or between two
- staff lines. In other words, the inner end of a flag always
- touches a staff line.
- */
- {
- if (adjust)
- {
- int p = (int) (rint (stem_end_position (me)));
- staffline_offs
- = Staff_symbol_referencer::on_line (me, p) ? "0" : "1";
- }
- else
- staffline_offs = "2";
- }
- else
- staffline_offs = "";
-
- char dir = (get_grob_direction (me) == UP) ? 'u' : 'd';
- string font_char = flag_style
- + to_string (dir) + staffline_offs + to_string (log);
- Font_metric *fm = Font_interface::get_default_font (me);
- Stencil flag = fm->find_by_name ("flags." + font_char);
- if (flag.is_empty ())
- me->warning (_f ("flag `%s' not found", font_char));
-
- SCM stroke_style_scm = me->get_property ("stroke-style");
- if (scm_is_string (stroke_style_scm))