2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2009 Han-Wen Nienhuys <hanwen@xs4all.nl>
12 #include "output-def.hh"
13 #include "font-interface.hh"
15 #include "staff-symbol-referencer.hh"
16 #include "international.hh"
18 MAKE_SCHEME_CALLBACK (Dots
, print
, 1);
22 Grob
*sc
= unsmob_grob (d
);
25 SCM c
= sc
->get_property ("dot-count");
27 if (scm_is_number (c
))
29 SCM scm_style
= sc
->get_property ("style");
31 if (scm_is_symbol (scm_style
))
32 style
= ly_symbol2string (scm_style
);
33 string idx
= "dots.dot" + style
;
34 Stencil d
= Font_interface::get_default_font (sc
)->find_by_name (idx
);
37 sc
->warning (_f ("dot `%s' not found", idx
.c_str ()));
40 Real dw
= d
.extent (X_AXIS
).length ();
43 we need to add a real blank box, to assure that
44 side-positioning doth not cancel the left-most padding. */
47 TODO: this should be handled by side-position padding.
49 mol
= Lookup::blank (Box (Interval (0, 0),
52 for (int i
= scm_to_int (c
); i
--;)
54 d
.translate_axis (2 * dw
, X_AXIS
);
55 mol
.add_at_edge (X_AXIS
, RIGHT
, d
, dw
);
58 return mol
.smobbed_copy ();
62 "The dots to go with a notehead or rest. @code{direction}"
63 " sets the preferred direction to move in case of staff line"
64 " collisions. @code{style} defaults to undefined, which is"
65 " normal 19th/20th century traditional style. Set"
66 " @code{style} to @code{vaticana} for ancient type dots.",