2 clef-item.cc -- implement Clef_item
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2000 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "molecule.hh"
14 #include "font-interface.hh"
17 FIXME: should use symbol for #'style.
19 MAKE_SCHEME_CALLBACK(Clef,before_line_breaking,1);
21 Clef::before_line_breaking (SCM smob)
23 Item * s = dynamic_cast<Item*> (unsmob_element (smob));
25 SCM style_sym =s->get_elt_property ("style");
27 if (gh_string_p (style_sym))
28 style = ly_scm2string (style_sym);
30 SCM glyph = s->get_elt_property ("glyph");
32 if (gh_string_p (glyph))
34 String str = ly_scm2string (glyph);
37 FIXME: should use fontsize property to set clef changes.
39 if (s->get_elt_property ("non-default") &&
40 s->break_status_dir() != RIGHT && style != "fullSizeChanges")
43 s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));
49 return SCM_UNSPECIFIED;
52 return SCM_UNSPECIFIED;
56 Clef::has_interface (Score_element* me)
58 return me->has_interface (ly_symbol2scm ("clef-interface"));
63 Clef::set_interface (Score_element* me)
65 me->set_interface (ly_symbol2scm ("clef-interface"));
71 MAKE_SCHEME_CALLBACK(Clef,brew_molecule,1)
73 Clef::brew_molecule (SCM smob)
75 Score_element * sc = unsmob_element (smob);
76 SCM glyph = sc->get_elt_property ("glyph");
77 if (gh_string_p (glyph))
79 return Font_interface::get_default_font (sc)->find_by_name (String (ly_scm2string (glyph))).create_scheme ();