2 textitem.cc -- implement Text_item
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
10 #include "musical-request.hh"
11 #include "paper-def.hh"
12 #include "text-item.hh"
14 #include "molecule.hh"
17 Text_item::Text_item(Text_def *tdef_l)
30 Text_item::~Text_item()
36 Text_item::init(Text_def *tdef_l)
38 tdef_p_ = new Text_def (*tdef_l);
41 Text_item::Text_item(Text_req* treq_l)
44 init(treq_l->tdef_p_);
45 dir_i_ = treq_l->dir_i_;
51 Text_item::set_default_index()
53 pos_i_ = get_position_i(tdef_p_->create_atom(paper()).extent().y );
57 Text_item::do_post_processing()
66 Text_item::brew_molecule_p() const
68 Molecule* mol_p = new Molecule(tdef_p_->create_atom(paper()));
70 if(dir_i_<0 ) // should do something better anyway.
71 mol_p->translate(Offset(0, -mol_p->extent().y.left ));
72 mol_p->translate(Offset(0, pos_i_ * paper()->internote()));
77 IMPLEMENT_STATIC_NAME(Text_item);