(staff_eligible): new function.
[lilypond.git] / lily / font-size-engraver.cc
blobf04842e158ac2e337965aa2d3fab3d6cacdeaebd
1 /*
2 font-size-engraver.cc -- implement
4 source file of the GNU LilyPond music typesetter
6 (c) 2001--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
8 */
10 #include "grob.hh"
11 #include "engraver.hh"
13 class Font_size_engraver : public Engraver
16 TRANSLATOR_DECLARATIONS(Font_size_engraver);
17 protected:
18 virtual void acknowledge_grob (Grob_info gi);
19 private:
23 Font_size_engraver::Font_size_engraver ()
29 TODO: use fontSize = NUMBER as a scaling constant: find the closest
30 integer design size, and use magnification to do the fractional bit.
32 void
33 Font_size_engraver::acknowledge_grob (Grob_info gi)
35 SCM sz = get_property ("fontSize");
37 if (gh_number_p (sz)
38 && gh_scm2double (sz)
39 && !gh_number_p (gi.grob_->get_grob_property ("font-relative-size")))
41 gi.grob_->set_grob_property ("font-relative-size", sz);
47 ENTER_DESCRIPTION(Font_size_engraver,
48 /* descr */ "Puts fontSize into font-relative-size grob property.",
49 /* creats*/ "",
50 /* accepts */ "",
51 /* acks */ "font-interface",
52 /* reads */ "fontSize",
53 /* write */ "");