2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 2001--2015 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/>.
21 #include "engraver.hh"
23 class Font_size_engraver : public Engraver
26 TRANSLATOR_DECLARATIONS (Font_size_engraver);
28 void acknowledge_font (Grob_info);
29 void process_music ();
34 Font_size_engraver::Font_size_engraver (Context *c)
41 Font_size_engraver::process_music ()
43 size = robust_scm2double (get_property ("fontSize"), 0.0);
47 Font_size_engraver::acknowledge_font (Grob_info gi)
50 We only want to process a grob once.
55 if (gi.context () != context ())
59 + robust_scm2double (gi.grob ()->get_property ("font-size"), 0);
60 gi.grob ()->set_property ("font-size", scm_from_double (font_size));
63 #include "translator.icc"
66 Font_size_engraver::boot ()
68 ADD_ACKNOWLEDGER (Font_size_engraver, font);
71 ADD_TRANSLATOR (Font_size_engraver,
73 "Put @code{fontSize} into @code{font-size} grob property.",