2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1998--2011 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
20 #include "directional-element-interface.hh"
21 #include "engraver.hh"
23 #include "side-position-interface.hh"
24 #include "stream-event.hh"
25 #include "text-interface.hh"
27 #include "translator.icc"
30 typeset directions that are plain text.
32 class Text_engraver : public Engraver
34 vector<Stream_event *> evs_;
36 TRANSLATOR_DECLARATIONS (Text_engraver);
38 void stop_translation_timestep ();
39 void process_music ();
41 DECLARE_TRANSLATOR_LISTENER (text_script);
44 IMPLEMENT_TRANSLATOR_LISTENER (Text_engraver, text_script);
46 Text_engraver::listen_text_script (Stream_event *ev)
52 Text_engraver::process_music ()
54 for (vsize i = 0; i < evs_.size (); i++)
56 Stream_event *r = evs_[i];
58 // URG: Text vs TextScript
59 Item *text = make_item ("TextScript", r->self_scm ());
61 int priority = robust_scm2int (text->get_property ("script-priority"),
64 /* see script-engraver.cc */
67 text->set_property ("script-priority", scm_from_int (priority));
69 Direction dir = to_dir (r->get_property ("direction"));
71 set_grob_direction (text, dir);
73 SCM mark = r->get_property ("text");
75 text->set_property ("text", mark);
80 Text_engraver::stop_translation_timestep ()
85 Text_engraver::Text_engraver ()
89 ADD_TRANSLATOR (Text_engraver,
91 "Create text scripts.",