3 clef.cc -- implement Clef_item
5 source file of the GNU LilyPond music typesetter
7 (c) 1997--2002 Han-Wen Nienhuys <hanwen@cs.uu.nl>
13 #include "molecule.hh"
15 #include "font-interface.hh"
18 FIXME: should use symbol for #'style.
20 MAKE_SCHEME_CALLBACK (Clef,before_line_breaking,1);
22 Clef::before_line_breaking (SCM smob)
24 Item * s = unsmob_item (smob);
26 SCM glyph = s->get_grob_property ("glyph-name");
28 if (gh_string_p (glyph))
30 String str = ly_scm2string (glyph);
32 if (to_boolean (s->get_grob_property ("non-default"))
33 && s->break_status_dir () != RIGHT
34 && !to_boolean (s->get_grob_property ("full-size-change")))
37 s->set_grob_property ("glyph-name", ly_str02scm (str.ch_C ()));
43 return SCM_UNSPECIFIED;
46 return SCM_UNSPECIFIED;
50 Clef::has_interface (Grob* me)
52 return me->has_interface (ly_symbol2scm ("clef-interface"));
57 Clef::set_interface (Grob* me)
59 me->set_interface (ly_symbol2scm ("clef-interface"));
62 MAKE_SCHEME_CALLBACK (Clef,brew_molecule,1)
64 Clef::brew_molecule (SCM smob)
66 Grob * sc = unsmob_grob (smob);
67 SCM glyph = sc->get_grob_property ("glyph-name");
68 if (gh_string_p (glyph))
70 return Font_interface::get_default_font (sc)->find_by_name (String (ly_scm2string (glyph))).smobbed_copy ();