]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-item.cc
release: 1.3.110
[lilypond.git] / lily / text-item.cc
index 3cec390b494a312b3c83b2d4294063d00cdc83a8..34c710db9dbc055a39eabcf16b0c6e1bfabf6893 100644 (file)
@@ -54,7 +54,7 @@
  */
 
 Molecule
-Text_item::text2molecule (Score_element *me, SCM text, SCM alist_chain) 
+Text_item::text2molecule (Grob *me, SCM text, SCM alist_chain) 
 {
   if (gh_string_p (text))
     return string2molecule (me, text, alist_chain);
@@ -67,24 +67,9 @@ Text_item::text2molecule (Score_element *me, SCM text, SCM alist_chain)
     }
   return Molecule ();
 }
-
-SCM
-ly_assoc_chain (SCM key, SCM achain)
-{
-  if (gh_pair_p (achain))
-    {
-      SCM handle = scm_assoc (key, gh_car (achain));
-      if (gh_pair_p (handle))
-       return handle;
-      else
-       return ly_assoc_chain (key, gh_cdr (achain));
-    }
-  else
-    return SCM_BOOL_F;
-}
             
 Molecule
-Text_item::string2molecule (Score_element *me, SCM text, SCM alist_chain)
+Text_item::string2molecule (Grob *me, SCM text, SCM alist_chain)
 {
   SCM style = ly_assoc_chain (ly_symbol2scm ("font-style"),
                              alist_chain);
@@ -105,21 +90,21 @@ Text_item::string2molecule (Score_element *me, SCM text, SCM alist_chain)
 }
 
 Molecule
-Text_item::lookup_character (Score_element *, Font_metric*fm, SCM char_name)
+Text_item::lookup_character (Grob *, Font_metric*fm, SCM char_name)
 {
   return fm->find_by_name (ly_scm2string (char_name));
 }
 
 
 Molecule
-Text_item::lookup_text (Score_element *me, Font_metric*fm, SCM text)
+Text_item::lookup_text (Grob *me, Font_metric*fm, SCM text)
 {
 #if 0
   /*
     Fixme; should be done differently, move to font-interface?
    */
 
-  SCM magnification = me->get_elt_property ("font-magnification");
+  SCM magnification = me->get_grob_property ("font-magnification");
 
   Font_metric* metric = 0;
   if (gh_number_p (magnification))
@@ -140,7 +125,7 @@ Text_item::lookup_text (Score_element *me, Font_metric*fm, SCM text)
 }
 
 Molecule
-Text_item::markup_sentence2molecule (Score_element *me, SCM markup_sentence,
+Text_item::markup_sentence2molecule (Grob *me, SCM markup_sentence,
                                     SCM alist_chain)
 {
   /*
@@ -195,16 +180,14 @@ MAKE_SCHEME_CALLBACK (Text_item, brew_molecule, 1);
 SCM 
 Text_item::brew_molecule (SCM smob)
 {
-  Score_element *me = unsmob_element (smob);
+  Grob *me = unsmob_grob (smob);
   
-  SCM text = me->get_elt_property ("text");
-
-  SCM properties = gh_list (me->immutable_property_alist_,
-                           me->mutable_property_alist_, SCM_UNDEFINED);
+  SCM text = me->get_grob_property ("text");
 
+  SCM properties = Font_interface::font_alist_chain (me);
   Molecule mol = Text_item::text2molecule (me, text, properties);
 
-  SCM space = me->get_elt_property ("word-space");
+  SCM space = me->get_grob_property ("word-space");
   if (gh_number_p (space))
     {
       Molecule m;
@@ -212,6 +195,6 @@ Text_item::brew_molecule (SCM smob)
       mol.add_at_edge (X_AXIS, RIGHT, m, gh_scm2double (space)
                       * Staff_symbol_referencer::staff_space (me));
     }
-  return mol.create_scheme (); 
+  return mol.smobbed_copy (); 
 }