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 "text-item.hh"
13 #include "staff-side.hh"
15 ADD_THIS_TRANSLATOR (Staff_margin_engraver);
17 Staff_margin_engraver::Staff_margin_engraver ()
21 visibility_lambda_ = ly_ch_C_eval_scm ("postbreak_only_visibility");
28 should be able to set whole paragraph (multiple lines, center) to
29 left (right?) of staff, e.g.:
32 2 Clarinetti |________
37 Staff_margin_engraver::acknowledge_element (Score_element_info inf)
39 Item *i = cast_to_interesting_item (inf.elem_l_);
40 if (!i || inf.origin_trans_l_arr_.size() != 1)
44 String long_str = get_property ("instrument", 0);
45 String short_str = get_property ("instr", 0);
46 if (now_mom () > Moment (0))
49 if (long_str.empty_b ())
53 text_p_->text_str_ = long_str;
54 staff_side_p_->dir_ = LEFT;
55 Bar_script_engraver::do_acknowledge_element (i);
58 UGH. ignores font size settings.
60 Interval iv(text_p_->extent (Y_AXIS));
61 text_p_->translate_axis (- iv.center (), Y_AXIS);