2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
12 #include "output-def.hh"
13 #include "font-interface.hh"
15 #include "staff-symbol-referencer.hh"
16 #include "directional-element-interface.hh"
17 #include "international.hh"
19 MAKE_SCHEME_CALLBACK (Dots, print, 1);
23 Grob *sc = unsmob_grob (d);
26 SCM c = sc->get_property ("dot-count");
28 if (scm_is_number (c))
30 SCM scm_style = sc->get_property ("style");
32 if (scm_is_symbol (scm_style))
33 style = ly_symbol2string (scm_style);
34 string idx = "dots.dot" + style;
35 Stencil d = Font_interface::get_default_font (sc)->find_by_name (idx);
38 sc->warning (_f ("dot `%s' not found", idx.c_str ()));
41 Real dw = d.extent (X_AXIS).length ();
44 we need to add a real blank box, to assure that
45 side-positioning doth not cancel the left-most padding. */
48 TODO: this should be handled by side-position padding.
50 mol = Lookup::blank (Box (Interval (0, 0),
53 for (int i = scm_to_int (c); i--;)
55 d.translate_axis (2 * dw, X_AXIS);
56 mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
59 return mol.smobbed_copy ();
62 ADD_INTERFACE (Dots, "dots-interface",
63 "The dots to go with a notehead or rest."
64 "@code{direction} sets the preferred direction to move in case of staff "