+ for (SCM s = me->get_object ("ideal-distances");
+ scm_is_pair (s); s = scm_cdr (s))
+ {
+ Spring *sp = unsmob_spring (scm_caar (s));
+ if (!unsmob_grob (scm_cdar (s))
+ || !unsmob_grob (scm_cdar (s))->get_system ())
+ continue;
+
+ j++;
+
+ Stencil arrowhead (musfont->find_by_name ("arrowheads.open.01"));
+ // initial scaling; it will also scale with font-size.
+ arrowhead.scale (1, 1.66);
+ Real head_len = arrowhead.extent (X_AXIS).length ();
+
+ SCM stil = Text_interface::interpret_markup (me->layout ()->self_scm (),
+ properties,
+ ly_string2scm (String_convert::form_string ("%5.2lf", sp->distance ())));
+ Stencil *number_stc = unsmob_stencil (stil);
+ number_stc->scale (1, 1.1);
+ Real num_height = number_stc->extent (Y_AXIS).length ();
+ Real num_len = number_stc->extent (X_AXIS).length ();
+ number_stc->align_to (Y_AXIS, DOWN);
+
+ // arrow's y-coord relative to the top of l stencil:
+ Real y = -2.5;
+ y -= j * (num_height + small_pad + big_pad);
+ // horizontally center number on the arrow, excluding arrowhead.
+ Offset num_off = Offset ((sp->distance () - num_len - head_len) / 2,
+ y + small_pad);
+
+ vector<Offset> pts;
+ pts.push_back (Offset (0, y));
+
+ Offset p2 (sp->distance (), y);
+ pts.push_back (p2);
+
+ Stencil id_stencil = Lookup::points_to_line_stencil (0.1, pts);
+ id_stencil.add_stencil (arrowhead.translated (p2));
+ id_stencil.add_stencil (number_stc->translated (num_off));
+ // use a lighter shade of blue so it will remain legible on black background.
+ id_stencil = id_stencil.in_color (0.2, 0.4, 1);
+ l.add_stencil (id_stencil);
+ }
+
+ for (SCM s = me->get_object ("minimum-distances");
+ scm_is_pair (s); s = scm_cdr (s))
+ {
+ Real dist = scm_to_double (scm_cdar (s));
+ Grob *other = unsmob_grob (scm_caar (s));
+ if (!other || other->get_system () != me->get_system ())
+ continue;
+
+ j++;
+
+ Stencil arrowhead (musfont->find_by_name ("arrowheads.open.01"));
+ // initial scaling; it will also scale with font-size.
+ arrowhead.scale (1, 1.66);
+ Real head_len = arrowhead.extent (X_AXIS).length ();
+
+ SCM stil = Text_interface::interpret_markup (me->layout ()->self_scm (),
+ properties,
+ ly_string2scm (String_convert::form_string ("%5.2lf", dist)));
+ Stencil *number_stc = unsmob_stencil (stil);
+ number_stc->scale (1, 1.1);
+ Real num_height = number_stc->extent (Y_AXIS).length ();
+ Real num_len = number_stc->extent (X_AXIS).length ();
+ number_stc->align_to (Y_AXIS, UP);
+
+ // arrow's y-coord relative to the top of l stencil:
+ Real y = -3;
+ y -= j * (num_height + small_pad + big_pad);
+ // horizontally center number on the arrow, excluding arrowhead.
+ Offset num_off = Offset ((dist - num_len - head_len) / 2,
+ y - small_pad);
+
+ vector<Offset> pts;
+ pts.push_back (Offset (0, y));
+
+ Offset p2 (dist, y);
+ pts.push_back (p2);
+
+ Stencil id_stencil = Lookup::points_to_line_stencil (0.1, pts);
+ id_stencil.add_stencil (arrowhead.translated (p2));
+ id_stencil.add_stencil (number_stc->translated (num_off));
+ // use a lighter shade of red so it will remain legible on black background.
+ id_stencil = id_stencil.in_color (1, 0.25, 0.25);
+ l.add_stencil (id_stencil);
+ }