- Real lt = me->paper_l ()->get_var ("linethickness");
-
- SCM thick = me->get_grob_property ("thickness");
- if (gh_number_p (thick))
- lt *= gh_scm2double (thick);
-
- SCM gap = me->get_grob_property ("gap");
-
- Real prot_size = 0.7; // magic.
-
- Molecule brack = make_bracket (Y_AXIS,
- w, ry-ly, lt,
- -prot_size*dir, -prot_size*dir,
- gh_scm2double (gap),
- 0.0, 0.0);
- mol.add_molecule (brack);
+ Real ss = Staff_symbol_referencer::staff_space (me);
+ Real gap = 0.;
+
+ if (!num.extent (X_AXIS).is_empty ())
+ gap = num.extent (X_AXIS).length () + 1.0;
+
+ SCM fl = me->get_property ("bracket-flare");
+ SCM eh = me->get_property ("edge-height");
+ SCM sp = me->get_property ("shorten-pair");
+
+ Direction d = LEFT;
+ Drul_array<Real> height, flare, shorten;
+ do
+ {
+ flare[d] = height[d] = shorten[d] = 0.0;
+ if (is_number_pair (fl))
+ flare[d] += ss * scm_to_double (index_get_cell (fl, d));
+ if (is_number_pair (eh))
+ height[d] += -dir * ss * scm_to_double (index_get_cell (eh, d));
+ if (is_number_pair (sp))
+ shorten[d] += ss * scm_to_double (index_get_cell (sp, d));
+ }
+ while (flip (&d) != LEFT);
+
+ Stencil brack = make_bracket (me, Y_AXIS,
+ Offset (w, ry - ly),
+ height,
+ /*
+ 0.1 = more space at right due to italics
+ TODO: use italic correction of font.
+ */
+ Interval (-0.5, 0.5) * gap + 0.1,
+ flare, shorten);
+ mol.add_stencil (brack);