2 text-spanner.cc -- implement Text_spanner
4 source file of the GNU LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
11 #include "text-spanner.hh"
12 #include "text-def.hh"
14 #include "paper-def.hh"
19 Text_spanner::set_support(Directional_spanner*d)
22 remove_dependency(support_span_l_);
28 Text_spanner::Text_spanner()
34 IMPLEMENT_STATIC_NAME(Text_spanner);
35 IMPLEMENT_IS_TYPE_B1(Text_spanner,Spanner);
38 Text_spanner::do_print() const
44 Text_spanner::do_post_processing()
46 text_off_ = support_span_l_->center() +
47 Offset(0,support_span_l_->dir_i_ * paper()->internote_f() * 4); // todo
51 Text_spanner::brew_molecule_p() const
53 Atom tsym (spec_p_->get_atom(paper(),0));
54 tsym.translate(text_off_);
56 Molecule*output = new Molecule;
62 Text_spanner::do_pre_processing()
64 right_col_l_ = support_span_l_->right_col_l_;
65 left_col_l_ = support_span_l_->left_col_l_;
66 assert(left_col_l_ && right_col_l_);
70 Text_spanner::height()const
72 return brew_molecule_p()->extent().y;
76 Text_spanner::do_substitute_dependency(Score_elem* o, Score_elem*n)
78 if (support_span_l_ == o)
79 support_span_l_ = (Directional_spanner*) (n?n->spanner():0);
83 Text_spanner::~Text_spanner()
88 Text_spanner::Text_spanner(Text_spanner const&s)
91 support_span_l_ = s.support_span_l_;
92 spec_p_ = s.spec_p_? s.spec_p_->clone() : 0;
93 text_off_ = s.text_off_;