]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-item.cc
* scm/define-grobs.scm: uniform naming for definitions and output
[lilypond.git] / lily / text-item.cc
index c84ee7e7f0509dcf10cf5831eb4eafdde28fefa9..098ef17402e5cad7cba87197374826aee0c61181 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
   
-  (c) 1998--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1998--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   Jan Nieuwenhuizen <janneke@gnu.org>
  */
 #include <math.h>
@@ -59,7 +59,18 @@ Text_item::text2molecule (Grob *me, SCM text, SCM alist_chain)
     }
   return Molecule ();
 }
-            
+
+
+MAKE_SCHEME_CALLBACK(Text_item,text_to_molecule,3);
+SCM
+Text_item::text_to_molecule (SCM grob, SCM props, SCM markup)
+{
+  Grob *me = unsmob_grob (grob);
+  
+  return Text_item::text2molecule (me, markup, props).smobbed_copy();
+}
+
+
 Molecule
 Text_item::string2molecule (Grob *me, SCM text, SCM alist_chain)
 {
@@ -230,7 +241,7 @@ Text_item::brew_molecule (SCM smob)
       Molecule m;
       m.set_empty (false);
       mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (space)
-                      * Staff_symbol_referencer::staff_space (me));
+                      * Staff_symbol_referencer::staff_space (me), 0);
     }
   return mol.smobbed_copy (); 
 }
@@ -238,5 +249,29 @@ Text_item::brew_molecule (SCM smob)
 
 
 ADD_INTERFACE (Text_item,"text-interface",
-  "A scheme markup text",
-  "text axis baseline-skip extent lookup raise kern word-space");
+  "A scheme markup text, see @ref{Markup functions}.",
+  "text baseline-skip word-space");
+
+
+/*
+  Ugh. Duplicated from Scheme.
+ */
+bool
+new_markup_p (SCM x)
+{
+  return
+    gh_string_p (x) ||
+    (gh_pair_p (x)
+     && SCM_BOOL_F != scm_object_property (gh_car (x), ly_symbol2scm ("markup-signature")));
+}
+
+SCM
+new_markup_brewer ()
+{
+  static SCM proc ;
+
+  if (!proc)
+    proc = scm_c_eval_string ("brew-new-markup-molecule");
+
+  return proc;
+}