2 text-engraver.cc -- implement Text_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1998--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
9 #include "directional-element-interface.hh"
10 #include "engraver.hh"
11 #include "rhythmic-head.hh"
12 #include "side-position-interface.hh"
14 #include "stream-event.hh"
15 #include "text-interface.hh"
18 #include "translator.icc"
21 typeset directions that are plain text.
23 class Text_engraver
: public Engraver
25 vector
<Stream_event
*> evs_
;
28 TRANSLATOR_DECLARATIONS (Text_engraver
);
30 void stop_translation_timestep ();
31 void process_acknowledged ();
33 DECLARE_TRANSLATOR_LISTENER (text_script
);
36 IMPLEMENT_TRANSLATOR_LISTENER (Text_engraver
, text_script
);
38 Text_engraver::listen_text_script (Stream_event
*ev
)
44 Text_engraver::process_acknowledged ()
48 for (vsize i
= 0; i
< evs_
.size (); i
++)
50 Stream_event
*r
= evs_
[i
];
52 // URG: Text vs TextScript
53 Item
*text
= make_item ("TextScript", r
->self_scm ());
55 int priority
= robust_scm2int (text
->get_property ("script-priority"),
58 /* see script-engraver.cc */
61 text
->set_property ("script-priority", scm_from_int (priority
));
63 Direction dir
= to_dir (r
->get_property ("direction"));
65 set_grob_direction (text
, dir
);
67 SCM mark
= r
->get_property ("text");
69 text
->set_property ("text", mark
);
70 texts_
.push_back (text
);
75 Text_engraver::stop_translation_timestep ()
81 Text_engraver::Text_engraver ()
85 ADD_TRANSLATOR (Text_engraver
,
87 "Create text scripts.",