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>
10 #include "clef-item.hh"
12 #include "molecule.hh"
17 Set a clef in a staff.
21 non-default -- not set because of existence of a bar?
23 change -- is this a change clef (smaller size)?
25 glyph -- a string determining what glyph is typeset
30 static SCM before_line_breaking (SCM);
35 FIXME: should use symbol.
38 MAKE_SCHEME_SCORE_ELEMENT_CALLBACK(Clef,before_line_breaking);
40 Clef::before_line_breaking (SCM smob)
42 Item * s = dynamic_cast<Item*> (unsmob_element (smob));
44 SCM style_sym =s->get_elt_property ("style");
46 if (gh_string_p (style_sym))
47 style = ly_scm2string (style_sym);
49 SCM glyph = s->get_elt_property ("glyph");
51 if (gh_string_p (glyph))
53 String str = ly_scm2string (glyph);
56 FIXME: should use fontsize property to set clef changes.
58 if (s->get_elt_property ("non-default") &&
59 s->break_status_dir() != RIGHT && style != "fullSizeChanges")
62 s->set_elt_property ("glyph", ly_str02scm (str.ch_C()));