2 script.cc -- implement Script
4 source file of the GNU LilyPond music typesetter
6 (c) 1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 TODO: Quantisation support (staccato dots between stafflines)
18 #include "staff-side.hh"
19 #include "paper-def.hh"
20 #include "dimension-cache.hh"
24 Script::get_molecule(Direction d) const
26 SCM s = get_elt_property ("molecule");
27 assert (s != SCM_UNDEFINED);
29 SCM key = SCM_CAR (s);
30 if (key == ly_symbol2scm ("feta"))
32 return lookup_l ()->afm_find ("scripts-" +
33 ly_scm2string (index_cell (gh_cdr (s), d)));
35 else if (key == ly_symbol2scm ("accordion"))
37 return lookup_l ()->accordion (s, paper_l()->get_var("interline"));
47 Script::do_pre_processing ()
50 center my self on the note head.
52 Graphical_element * e = parent_l(X_AXIS);
53 translate_axis (e->extent (X_AXIS).center (), X_AXIS);
57 Script::do_post_processing ()
59 Direction d = Staff_sidify (this).get_direction ();
60 Molecule m (get_molecule(d));
66 if (staff_side_l_->get_elt_property ("no-staff-support") == SCM_UNDEFINED)
67 translate_axis (- m.dim_[Y_AXIS][Direction (-d)], Y_AXIS);
73 Script::do_brew_molecule_p () const
76 SCM d = get_elt_property ("direction");
80 return new Molecule (get_molecule (dir));