2 mark-engraver.cc -- implement Mark_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998 Jan Nieuwenhuizen <janneke@gnu.org>
9 #include "mark-engraver.hh"
10 #include "text-def.hh"
12 #include "paper-def.hh"
13 #include "command-request.hh"
14 #include "time-description.hh"
15 #include "engraver-group.hh"
18 ADD_THIS_TRANSLATOR (Mark_engraver);
20 Mark_engraver::Mark_engraver ()
27 Mark_engraver::do_try_music (Music* r_l)
29 if (Mark_req *mr = dynamic_cast <Mark_req *> (r_l))
38 Mark_engraver::do_process_requests ()
40 if (!mark_req_l_ || script_p_)
43 script_p_ = new Script;
44 script_p_->breakable_b_ = true;
46 Text_def *td_p = new Text_def;
48 td_p->text_str_ = mark_req_l_->str_;
49 td_p->align_dir_ = CENTER;
51 td_p->style_str_ = td_p->text_str_.index_any_i ("0123456789") >= 0
54 script_p_->dir_ = LEFT;
55 script_p_->specs_p_ = td_p->clone ();
56 script_p_->postbreak_only_b_ = true;
58 Scalar padding = get_property ("markScriptPadding");
59 if (padding.length_i() && padding.isnum_b ())
61 script_p_->padding_f_ = Real(padding);
63 Scalar break_priority = get_property ("markBreakPriority");
64 if (break_priority.length_i() && break_priority.isnum_b ())
66 script_p_->break_priority_i_ = int(break_priority);
70 announce_element (Score_element_info (script_p_, mark_req_l_));
74 Mark_engraver::do_pre_move_processing ()
78 typeset_element (script_p_);