]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/time-signature.cc
* lily/font-interface.cc (text_font_alist_chain): rename function,
[lilypond.git] / lily / time-signature.cc
index 4c96b217717c58da79a566495aba9180915fe8d5..7d414ab26841e28afa1e85e0cc07f285d2388bc2 100644 (file)
@@ -3,12 +3,12 @@
   
   source file of the GNU LilyPond music typesetter
   
-  (c) 1996--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1996--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
   
  */
 
 
-#include "molecule.hh"
+#include "stencil.hh"
 #include "text-item.hh"
 #include "time-signature.hh"
 #include "paper-def.hh"
   
  */
 
-MAKE_SCHEME_CALLBACK (Time_signature, brew_molecule, 1);
+MAKE_SCHEME_CALLBACK (Time_signature, print, 1);
 SCM
-Time_signature::brew_molecule (SCM smob) 
+Time_signature::print (SCM smob) 
 {
   Grob * me = unsmob_grob (smob);
-  SCM st = me->get_grob_property ("style");
-  SCM frac = me->get_grob_property ("fraction");
+  SCM st = me->get_property ("style");
+  SCM frac = me->get_property ("fraction");
   int n = 4;
   int d = 4;
   if (gh_pair_p (frac))
@@ -40,7 +40,7 @@ Time_signature::brew_molecule (SCM smob)
       d = gh_scm2int (ly_cdr (frac));
     }
 
-  Molecule m;
+  Stencil m;
   if (gh_symbol_p (st))
     {
       String style (ly_scm2string (scm_symbol_to_string (st)));
@@ -62,7 +62,7 @@ Time_signature::brew_molecule (SCM smob)
   return m.smobbed_copy ();
 }
 
-Molecule
+Stencil
 Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
 {
   String style = ly_scm2string (scm_symbol_to_string (scm_style));
@@ -84,8 +84,8 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
     }
 
   String char_name = style + to_string (n) + "/" + to_string (d);
-  me->set_grob_property ("font-family", ly_symbol2scm ("music"));
-  Molecule out = Font_interface::get_default_font (me)
+  me->set_property ("font-family", ly_symbol2scm ("music"));
+  Stencil out = Font_interface::get_default_font (me)
     ->find_by_name ("timesig-" + char_name);
   if (!out.is_empty ())
     return out;
@@ -97,25 +97,24 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
   return numbered_time_signature (me, n, d);
 }
 
-Molecule
+Stencil
 Time_signature::numbered_time_signature (Grob*me,int num, int den)
 {
-  SCM chain = Font_interface::font_alist_chain (me);
-  me->set_grob_property ("font-family", ly_symbol2scm ("number"));
-
-SCM sn =
-    Text_item::interpret_markup (me->get_paper ()->self_scm(), chain,
+  SCM number_def = scm_list_1 (gh_cons (ly_symbol2scm ("font-encoding"),
+                                       ly_symbol2scm ("number")));
+                                       
+  SCM chain = me->get_property_alist_chain (number_def);
+  SCM sn = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
                                 scm_makfrom0str (to_string (num).to_str0 ()));
-SCM sd =
-    Text_item::interpret_markup (me->get_paper ()->self_scm(), chain,
+  SCM sd = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
                                 scm_makfrom0str (to_string (den).to_str0 ()));
 
-  Molecule n = *unsmob_molecule (sn);
-  Molecule d = *unsmob_molecule (sd);
+  Stencil n = *unsmob_stencil (sn);
+  Stencil d = *unsmob_stencil (sd);
                              
   n.align_to (X_AXIS, CENTER);
   d.align_to (X_AXIS, CENTER);
-  Molecule m;
+  Stencil m;
   if (den)
     {
       m.add_at_edge (Y_AXIS, UP, n, 0.0, 0);