2 text-def.cc -- implement Text_def
4 source file of the GNU LilyPond music typesetter
6 (c) 1996, 1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "paper-def.hh"
13 #include "molecule.hh"
14 #include "text-def.hh"
17 Text_def::staff_dir () const
19 if (style_str_
== "finger")
26 Text_def::do_print() const
29 DOUT
<< "align " << align_dir_
<< " `" << text_str_
<< "'";
40 Text_def::do_equal_b (General_script_def
const *gdef
) const
42 Text_def
const *def
= dynamic_cast<Text_def
const*>(gdef
);
43 return def
&& align_dir_
== def
->align_dir_
&& text_str_
== def
->text_str_
44 && style_str_
== def
->style_str_
;
48 Text_def::get_molecule (Paper_def
*p
, Direction
) const
50 Molecule a
= p
->lookup_l(0)->text (style_str_
, text_str_
);
52 a
.translate_axis (-(align_dir_
+ 1)* a
.dim_
[X_AXIS
].center (), X_AXIS
);
58 Text_def::print() const
60 DOUT
<< "Text `" << text_str_
<< "\', style " <<
61 style_str_
<< "align " << align_dir_
<< '\n';