]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-item.cc
patch::: 1.3.57.jcn2
[lilypond.git] / lily / text-item.cc
index 3f19466ee141456af55d37c084ec8be5def38bcf..35e5aa5c3dfca2e8242ea7c5f6d14183118374e2 100644 (file)
@@ -3,7 +3,7 @@
 
   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; 
 }
+
+