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))
d = gh_scm2int (ly_cdr (frac));
}
- Molecule m;
+ Stencil m;
if (gh_symbol_p (st))
{
String style (ly_scm2string (scm_symbol_to_string (st)));
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));
}
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;
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);