* scm/beam.scm (check-slope-callbacks): check sign of slope.
[lilypond.git] / lily / dots.cc
blobc93a6f8c67c0a9e6640d8f80e79fee6da7906781
1 /*
2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
9 #include "dots.hh"
10 #include "item.hh"
11 #include "stencil.hh"
12 #include "output-def.hh"
13 #include "font-interface.hh"
14 #include "lookup.hh"
15 #include "staff-symbol-referencer.hh"
16 #include "directional-element-interface.hh"
18 MAKE_SCHEME_CALLBACK (Dots,print,1);
19 SCM
20 Dots::print (SCM d)
22 Grob *sc = unsmob_grob (d);
23 Stencil mol;
25 SCM c = sc->get_property ("dot-count");
27 if (ly_c_number_p (c))
29 Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots-dot"));
30 Real dw = d.extent (X_AXIS).length ();
34 we need to add a real blank box, to assure that
35 side-positioning doth not cancel the left-most padding. */
38 TODO: this should be handled by side-position padding.
40 mol = Lookup::blank (Box (Interval (0,0),
41 Interval (0,0)));
43 for (int i = ly_scm2int (c); i--;)
45 d.translate_axis (2*dw,X_AXIS);
46 mol.add_at_edge (X_AXIS, RIGHT, d, dw, 0);
49 return mol.smobbed_copy ();
55 ADD_INTERFACE (Dots, "dots-interface",
56 "The dots to go with a notehead or rest."
57 "@code{direction} sets the preferred direction to move in case of staff "
58 "line collisions.",
59 "direction dot-count");