2 staff-margin-engraver.cc -- implement Staff_margin_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--1999 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "staff-margin-engraver.hh"
11 #include "time-description.hh"
12 #include "g-text-item.hh"
13 #include "g-staff-side.hh"
15 ADD_THIS_TRANSLATOR (Staff_margin_engraver
);
17 Staff_margin_engraver::Staff_margin_engraver ()
22 = gh_eval_str ("postbreak_only_visibility");
29 should be able to set whole paragraph (multiple lines, center) to
30 left (right?) of staff, e.g.:
33 2 Clarinetti |________
38 Staff_margin_engraver::acknowledge_element (Score_element_info inf
)
40 Item
*i
= cast_to_interesting_item (inf
.elem_l_
);
41 if (!i
|| inf
.origin_trans_l_arr_
.size() != 1)
45 String long_str
= get_property ("instrument", 0);
46 String str
= get_property ("instr", 0);
47 if (now_mom () > Moment (0) && str
.length_i ())
50 if (long_str
.empty_b ())
54 text_p_
->text_str_
= long_str
;
55 staff_side_p_
->dir_
= LEFT
;
56 Bar_script_engraver::do_acknowledge_element (i
);
59 UGH. ignores font size settings.
61 Interval
iv(text_p_
->extent (Y_AXIS
));
62 text_p_
->translate_axis (- iv
.center (), Y_AXIS
);