- Molecule left_edge =
- Lookup::horizontal_slope (thickness, corrected_slope, height);
- molecule.add_molecule(left_edge);
-
- Molecule right_edge =
- Lookup::horizontal_slope (thickness, corrected_slope, height);
- right_edge.translate_axis (width-thickness, X_AXIS);
- right_edge.translate_axis (corrected_slope * (width-thickness), Y_AXIS);
- molecule.add_molecule(right_edge);
-
- Molecule bottom_edge =
- Lookup::horizontal_slope (width, corrected_slope, thickness);
- bottom_edge.translate_axis (-0.5*height, Y_AXIS);
- molecule.add_molecule (bottom_edge);
-
- Molecule top_edge =
- Lookup::horizontal_slope (width, corrected_slope, thickness);
- top_edge.translate_axis (+0.5*height, Y_AXIS);
- molecule.add_molecule (top_edge);
- }
- molecule.translate_axis (ypos_correction, Y_AXIS);
- return molecule;
-}
-
-void
-add_ledger_lines (Grob *me, Molecule *out, int pos, Real offs,
- bool ledger_take_space)
-{
- int interspaces = Staff_symbol_referencer::line_count (me)-1;
- if (abs (pos) - interspaces > 1)
- {
- Interval hd = out->extent (X_AXIS);
- Real left_ledger_protusion = hd.length ()/4;
- Real right_ledger_protusion = left_ledger_protusion;
-
- Interval l_extents = Interval (hd[LEFT] - left_ledger_protusion,
- hd[RIGHT] + right_ledger_protusion);
- Molecule ledger_lines =
- Note_head::brew_ledger_lines (me, pos, interspaces,
- l_extents,
- ledger_take_space);
- ledger_lines.translate_axis (offs, Y_AXIS);
- out->add_molecule (ledger_lines);
+ /*
+ The thickness of the horizontal lines of the flexa shape
+ should be equal to that of the horizontal lines of the
+ neomensural brevis note head (see mf/parmesan-heads.mf).
+ */
+ Real const horizontal_line_thickness = staff_space * 0.35;
+
+ // URGH! vertical_line_thickness is adjustable (via thickness
+ // property), while horizontal_line_thickness is constant.
+ // Maybe both should be adjustable independently?
+
+ Real height = staff_space - horizontal_line_thickness;
+
+ Stencil left_edge
+ = Lookup::beam (corrected_slope, vertical_line_thickness, height, 0.0);
+ stencil.add_stencil (left_edge);
+
+ Stencil right_edge
+ = Lookup::beam (corrected_slope, vertical_line_thickness, height, 0.0);
+ right_edge.translate_axis (width - vertical_line_thickness, X_AXIS);
+ right_edge.translate_axis ((width - vertical_line_thickness) *
+ corrected_slope, Y_AXIS);
+ stencil.add_stencil (right_edge);
+
+ Stencil bottom_edge
+ = Lookup::beam (corrected_slope, width,
+ horizontal_line_thickness, 0.0);
+ bottom_edge.translate_axis (-0.5 * height, Y_AXIS);
+ stencil.add_stencil (bottom_edge);
+
+ Stencil top_edge
+ = Lookup::beam (corrected_slope, width,
+ horizontal_line_thickness, 0.0);
+ top_edge.translate_axis (+0.5 * height, Y_AXIS);
+ stencil.add_stencil (top_edge);