2 This file is part of LilyPond, the GNU music typesetter.
4 Copyright (C) 1997--2015 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"
31 MAKE_SCHEME_CALLBACK (Dots, print, 1);
35 Grob *sc = unsmob<Grob> (d);
38 SCM c = sc->get_property ("dot-count");
40 if (scm_is_number (c))
42 SCM scm_style = sc->get_property ("style");
44 if (scm_is_symbol (scm_style))
45 style = ly_symbol2string (scm_style);
46 string idx = "dots.dot" + style;
47 Stencil d = Font_interface::get_default_font (sc)->find_by_name (idx);
50 sc->warning (_f ("dot `%s' not found", idx.c_str ()));
53 Real dw = d.extent (X_AXIS).length ();
56 we need to add a real blank box, to assure that
57 side-positioning doth not cancel the left-most padding. */
60 TODO: this should be handled by side-position padding.
62 mol = Lookup::blank (Box (Interval (0, 0),
65 for (int i = scm_to_int (c); i--;)
67 mol.add_at_edge (X_AXIS, RIGHT, d, dw);
70 return mol.smobbed_copy ();
74 "The dots to go with a notehead or rest. @code{direction}"
75 " sets the preferred direction to move in case of staff line"
76 " collisions. @code{style} defaults to undefined, which is"
77 " normal 19th/20th century traditional style. Set"
78 " @code{style} to @code{vaticana} for ancient type dots.",