2 text-item.cc -- implement Item
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "molecule.hh"
12 #include "paper-def.hh"
14 #include "staff-symbol-referencer.hh"
18 static SCM
brew_molecule (SCM
);
22 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Text_item
,brew_molecule
)
25 Text_item::brew_molecule (SCM sm
)
27 Score_element
* s
= unsmob_element (sm
);
29 SCM style
= s
->get_elt_property ("style");
30 String st
= gh_string_p (style
) ? ly_scm2string (style
) : "";
31 SCM txt
= s
-> get_elt_property ("text");
32 String t
= gh_string_p (txt
) ? ly_scm2string (txt
) : "";
34 Molecule mol
= s
->paper_l ()->lookup_l(0)->text (st
, t
, s
->paper_l ());
36 SCM space
= s
->get_elt_property ("word-space");
37 if (gh_number_p (space
))
41 mol
.add_at_edge (X_AXIS
, RIGHT
, m
, gh_scm2double (space
)*
42 staff_symbol_referencer (s
).staff_space ());
44 return mol
.create_scheme ();