source file of the GNU LilyPond music typesetter
- (c) 1998--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+ (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
*/
#include "molecule.hh"
#include "paper-def.hh"
#include "lookup.hh"
+#include "staff-symbol-referencer.hh"
-Molecule*
-Text_item::do_brew_molecule_p () const
+Text_item::Text_item (SCM s)
+ : Item (s)
{
- Molecule a= paper_l ()->lookup_l(0)->text (style_str_,text_str_, paper_l ());
-
- return new Molecule (a);
+
}
-Text_item::Text_item ()
-{
- style_str_ = "roman";
-}
+MAKE_SCHEME_SCORE_ELEMENT_CALLBACKS(Text_item)
-void
-Text_item::do_print () const
+Molecule
+Text_item::do_brew_molecule () const
{
- DOUT << "text= " << text_str_;
+ SCM style = get_elt_property ("style");
+ String st = gh_string_p (style) ? ly_scm2string (style) : "";
+ SCM txt = get_elt_property ("text");
+ String t = gh_string_p (txt) ? ly_scm2string (txt) : "";
+
+ Molecule mol = paper_l ()->lookup_l(0)->text (st, t, paper_l ());
+
+ SCM s = get_elt_property ("word-space");
+ if (gh_number_p (s))
+ {
+ Molecule m;
+ m.set_empty (false);
+ mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (s)*
+ staff_symbol_referencer (this).staff_space ());
+ }
+ return mol;
}
+
+