]> git.donarmstrong.com Git - lilypond.git/blob - lily/ligature-head.cc
ee1690ac4ab8ffcc60ea6e596113a8492857b95b
[lilypond.git] / lily / ligature-head.cc
1 /*
2   ligature-head.cc -- implement Ligature_head
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2002 Juergen Reuter <reuter@ipd.uka.de>
7 */
8
9 #include "ligature-head.hh"
10 #include "item.hh"
11 #include "note-head.hh"
12 #include "warn.hh"
13
14 /*
15  * TODO: in scm/grob-description.scm, LigatureHead must contain value
16  * "rhythmic-head-interface" in the interfaces list.  Otherwise, text
17  * scripts (such as fermata) are horizontally aligned with the end of
18  * the ligature rather than with the associated head.  Why?
19  *
20  * TODO: if properties font-family and style are not set properly
21  * (e.g. by a user erronously setting font-family to #'music),
22  * lilypond currently crashes with the message: "lilypond:
23  * ../flower/include/interval.hh:28: Real Interval_t<double>::center()
24  * const: Assertion `!empty_b ()' failed.".  The code of this class
25  * should be clever enough to foresee a potential crash, print a
26  * warning, and supply sensible default values that avoid the crash.
27  */
28 MAKE_SCHEME_CALLBACK (Ligature_head,brew_molecule,1);
29 SCM
30 Ligature_head::brew_molecule (SCM smob)  
31 {
32   Grob *me = unsmob_grob (smob);
33   SCM brew_ligature_primitive_proc =
34     me->get_grob_property ("ligature-primitive-callback");
35   if (brew_ligature_primitive_proc != SCM_EOL)
36     {
37       return gh_call1 (brew_ligature_primitive_proc, smob);
38     }
39   else
40     {
41       warning ("Ligature_head: ligature-primitive-callback undefined -> resorting to Note_head::brew_molecule");
42       return Note_head::brew_molecule (smob);
43     }
44 }
45
46 /*
47   UGH  primitive is only used within the engraver.
48 */
49 ADD_INTERFACE (Ligature_head,"ligature-head-interface","Ligature head",
50                "primitive ligature-primitive-callback thickness flexa-width head-width delta-pitch join-left");