2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2012 Han-Wen Nienhuys <hanwen@xs4all.nl>
6 LilyPond is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
11 LilyPond is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with LilyPond. If not, see <http://www.gnu.org/licenses/>.
23 #include "output-def.hh"
24 #include "font-interface.hh"
26 #include "staff-symbol-referencer.hh"
27 #include "international.hh"
29 MAKE_SCHEME_CALLBACK (Dots, print, 1);
33 Grob *sc = unsmob_grob (d);
36 SCM c = sc->get_property ("dot-count");
38 if (scm_is_number (c))
40 SCM scm_style = sc->get_property ("style");
42 if (scm_is_symbol (scm_style))
43 style = ly_symbol2string (scm_style);
44 string idx = "dots.dot" + style;
45 Stencil d = Font_interface::get_default_font (sc)->find_by_name (idx);
48 sc->warning (_f ("dot `%s' not found", idx.c_str ()));
51 Real dw = d.extent (X_AXIS).length ();
54 we need to add a real blank box, to assure that
55 side-positioning doth not cancel the left-most padding. */
58 TODO: this should be handled by side-position padding.
60 mol = Lookup::blank (Box (Interval (0, 0),
63 for (int i = scm_to_int (c); i--;)
65 d.translate_axis (2 * dw, X_AXIS);
66 mol.add_at_edge (X_AXIS, RIGHT, d, dw);
69 return mol.smobbed_copy ();
73 "The dots to go with a notehead or rest. @code{direction}"
74 " sets the preferred direction to move in case of staff line"
75 " collisions. @code{style} defaults to undefined, which is"
76 " normal 19th/20th century traditional style. Set"
77 " @code{style} to @code{vaticana} for ancient type dots.",