2 font-size-engraver.cc -- implement Font_size_engraver
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
10 #include "engraver.hh"
12 class Font_size_engraver : public Engraver
15 TRANSLATOR_DECLARATIONS (Font_size_engraver);
17 virtual void acknowledge_grob (Grob_info gi);
21 Font_size_engraver::Font_size_engraver ()
27 Font_size_engraver::acknowledge_grob (Grob_info gi)
29 SCM sz = get_property ("fontSize");
32 We only want to process a grob once.
34 if (gi.origin_trans_->context () != context ())
37 if (scm_is_number (sz) && scm_to_double (sz))
39 Real font_size = scm_to_double (sz);
41 font_size += robust_scm2double (gi.grob_->get_property ("font-size"), 0);
42 gi.grob_->set_property ("font-size", scm_make_real (font_size));
46 ADD_TRANSLATOR (Font_size_engraver,
47 /* descr */ "Puts fontSize into font-relative-size grob property.",
50 /* acks */ "font-interface",
51 /* reads */ "fontSize",