2 lyric-engraver.cc -- implement Lyric_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--1998 Han-Wen Nienhuys <hanwen@cs.uu.nl>
9 #include "lyric-engraver.hh"
10 #include "musical-request.hh"
11 #include "text-item.hh"
12 #include "paper-def.hh"
14 #include "paper-def.hh"
17 Lyric_engraver::Lyric_engraver()
24 Lyric_engraver::do_try_request (Request*r)
26 Musical_req * m =r->access_Musical_req ();
27 if (!m || ! m->access_Lyric_req ())
29 lreq_l_ = m->access_Lyric_req ();
35 Lyric_engraver::do_process_requests()
39 Text_def *td_p = new Text_def;
40 td_p->text_str_ = lreq_l_->text_str_;
41 td_p->align_dir_ = LEFT;
42 Scalar style = get_property ("textstyle");
43 if (style.length_i ())
45 td_p->style_str_ = style;
47 Scalar alignment = get_property ("textalignment");
48 if (alignment.isnum_b())
50 td_p->align_dir_= (Direction)(int)alignment;
53 lyric_item_p_ = new Text_item (td_p);
55 lyric_item_p_->dir_ = DOWN;
56 lyric_item_p_->fat_b_ = true;
57 announce_element (Score_element_info (lyric_item_p_, lreq_l_));
62 Lyric_engraver::do_post_move_processing()
68 Lyric_engraver::do_pre_move_processing()
72 typeset_element (lyric_item_p_);
78 IMPLEMENT_IS_TYPE_B1(Lyric_engraver,Engraver);
79 ADD_THIS_TRANSLATOR(Lyric_engraver);