+Molecule
+Bar::compound_barline (String str, Real h) const
+{
+ Real kern = paper_l()->get_var ("bar_kern");
+ Real thinkern = paper_l()->get_var ("bar_thinkern");
+
+ Molecule thin = simple_barline (paper_l()->get_var ("barthick_thin"), h);
+ Molecule thick = simple_barline (paper_l()->get_var ("barthick_thick"), h);
+ Molecule colon = lookup_l ()->afm_find ("dots-repeatcolon");
+
+ Molecule m;
+
+ if (str == "")
+ {
+ return lookup_l ()->blank (Box (Interval(0, 0), Interval (-h/2, h/2)));
+ }
+ if (str == "scorepostbreak")
+ {
+ return simple_barline (paper_l ()->get_var ("barthick_score"), h);
+ }
+ else if (str == "|")
+ {
+ return thin;
+ }
+ else if (str == "|.")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, 0);
+ m.add_at_edge (X_AXIS, LEFT, thin, kern);
+ }
+ else if (str == ".|")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+ }
+ else if (str == ":|")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, 0);
+ m.add_at_edge (X_AXIS, LEFT, thin, kern);
+ m.add_at_edge (X_AXIS, LEFT, colon, kern);
+ }
+ else if (str == "|:")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thick, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, kern);
+ m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+ }
+ else if (str == ":|:")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+ m.add_at_edge (X_AXIS, LEFT, colon, kern);
+ m.add_at_edge (X_AXIS, RIGHT, thick, kern);
+ m.add_at_edge (X_AXIS, RIGHT, colon, kern);
+ }
+ else if (str == ".|.")
+ {
+ m.add_at_edge (X_AXIS, LEFT, thick, thinkern);
+ m.add_at_edge (X_AXIS, RIGHT, thick, kern);
+ }
+ else if (str == "||")
+ {
+ m.add_at_edge (X_AXIS, RIGHT, thin, 0);
+ m.add_at_edge (X_AXIS, RIGHT, thin, thinkern);
+ }
+
+ return m;
+}
+
+/*
+ ugh. Suck me plenty.
+ */
+Molecule
+Bar::staff_brace (Real y) const
+{
+ Real staffht = paper_l ()->get_var ("staffheight");
+ int staff_size = int (rint (staffht ));
+
+ // URG
+ Real step = 1.0;
+ int minht = 2 * staff_size;
+ int maxht = 7 * minht;
+ int idx = int (((maxht - step) <? y - minht) / step);
+ idx = idx >? 0;
+
+ SCM l = ly_eval_str ("(style-to-cmr \"brace\")");
+ String nm = "feta-braces";
+ if (l != SCM_BOOL_F)
+ nm = ly_scm2string (gh_cdr (l));
+ nm += to_str (staff_size);
+ SCM e =gh_list (ly_symbol2scm ("char"), gh_int2scm (idx), SCM_UNDEFINED);
+ SCM at = (e);
+
+ at = fontify_atom (all_fonts_global_p->find_font (nm), at);
+
+ Box b ( Interval (-y/2,y/2),
+ Interval (0,0));
+ return Molecule(b, at);
+}
+
+
+Molecule
+Bar::simple_barline (Real w, Real h) const
+{
+ return lookup_l ()->filledbox (Box (Interval(0,w), Interval(-h/2, h/2)));
+}