2 text-item.cc -- implement Text_item
4 source file of the GNU 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 (General_script_def
*tdef_l
, Direction d
)
21 tdef_p_
= tdef_l
->clone();
24 Text_item::~Text_item()
30 Text_item::do_pre_processing()
37 Text_item::symbol_height() const
39 return tdef_p_
->get_atom (paper(), dir_
).sym_
.dim
.y ();
43 Text_item::brew_molecule_p() const
45 Atom
a (tdef_p_
->get_atom (paper(), dir_
));
49 a.sym.dim.x = tdef_p_->width (paper());
51 Molecule
* mol_p
= new Molecule (a
);
53 if (dir_
<0) // should do something better anyway.
54 mol_p
->translate (-mol_p
->extent().y ().left
, Y_AXIS
);
55 mol_p
->translate (pos_i_
* paper()->internote_f (), Y_AXIS
);
61 IMPLEMENT_IS_TYPE_B1(Text_item
,Item
);