2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1998--2009 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"
22 #include "rhythmic-head.hh"
23 #include "side-position-interface.hh"
25 #include "stream-event.hh"
26 #include "text-interface.hh"
29 #include "translator.icc"
32 typeset directions that are plain text.
34 class Text_engraver : public Engraver
36 vector<Stream_event *> evs_;
39 TRANSLATOR_DECLARATIONS (Text_engraver);
41 void stop_translation_timestep ();
42 void process_acknowledged ();
44 DECLARE_TRANSLATOR_LISTENER (text_script);
47 IMPLEMENT_TRANSLATOR_LISTENER (Text_engraver, text_script);
49 Text_engraver::listen_text_script (Stream_event *ev)
55 Text_engraver::process_acknowledged ()
59 for (vsize i = 0; i < evs_.size (); i++)
61 Stream_event *r = evs_[i];
63 // URG: Text vs TextScript
64 Item *text = make_item ("TextScript", r->self_scm ());
66 int priority = robust_scm2int (text->get_property ("script-priority"),
69 /* see script-engraver.cc */
72 text->set_property ("script-priority", scm_from_int (priority));
74 Direction dir = to_dir (r->get_property ("direction"));
76 set_grob_direction (text, dir);
78 SCM mark = r->get_property ("text");
80 text->set_property ("text", mark);
81 texts_.push_back (text);
86 Text_engraver::stop_translation_timestep ()
92 Text_engraver::Text_engraver ()
96 ADD_TRANSLATOR (Text_engraver,
98 "Create text scripts.",