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 ()
26 Font_size_engraver::acknowledge_grob (Grob_info gi)
28 SCM sz = get_property ("fontSize");
31 We only want to process a grob once.
33 if (gi.context () != context ())
36 if (scm_is_number (sz) && scm_to_double (sz))
38 Real font_size = scm_to_double (sz);
40 font_size += robust_scm2double (gi.grob ()->get_property ("font-size"), 0);
41 gi.grob ()->set_property ("font-size", scm_make_real (font_size));
45 ADD_TRANSLATOR (Font_size_engraver,
46 /* descr */ "Puts fontSize into font-relative-size grob property.",
49 /* acks */ "font-interface",
50 /* reads */ "fontSize",