2 text-spanner.cc -- implement Text_spanner
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 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_);
29 Text_spanner::do_add_processing ()
31 set_bounds (LEFT, support_span_l_->spanned_drul_[LEFT]);
32 set_bounds (RIGHT, support_span_l_->spanned_drul_[RIGHT]);
35 Text_spanner::Text_spanner()
42 IMPLEMENT_IS_TYPE_B1(Text_spanner,Spanner);
45 Text_spanner::do_print() const
51 Text_spanner::do_post_processing()
53 text_off_ = support_span_l_->center() +
54 Offset (0,support_span_l_->dir_ * paper()->internote_f () * 4); // todo
58 Text_spanner::brew_molecule_p() const
60 Atom tsym (spec_p_->get_atom (paper(),CENTER));
61 tsym.translate (text_off_);
63 Molecule*output = new Molecule;
69 Text_spanner::do_pre_processing()
71 spanned_drul_ = support_span_l_->spanned_drul_;
75 Text_spanner::height() const
77 return brew_molecule_p()->extent ().y ();
81 Text_spanner::do_substitute_dependency (Score_elem* o, Score_elem*n)
83 if (support_span_l_ == o)
84 support_span_l_ = (Directional_spanner*) (n?n->spanner():0);
88 Text_spanner::~Text_spanner()
93 Text_spanner::Text_spanner (Text_spanner const&s)
96 support_span_l_ = s.support_span_l_;
97 spec_p_ = s.spec_p_? s.spec_p_->clone() : 0;
98 text_off_ = s.text_off_;