2 dots.cc -- implement Dots
4 source file of the GNU LilyPond music typesetter
6 (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
11 #include "molecule.hh"
12 #include "paper-def.hh"
13 #include "font-interface.hh"
15 #include "staff-symbol-referencer.hh"
16 #include "directional-element-interface.hh"
18 MAKE_SCHEME_CALLBACK (Dots,brew_molecule,1);
20 Dots::brew_molecule (SCM d)
22 Grob *sc = unsmob_grob (d);
25 SCM c = sc->get_grob_property ("dot-count");
29 Molecule 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),
43 for (int i = gh_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/rest. A separate interface, since they "
57 " are a party in collision resolution. "
58 " #'direction is the Direction to handle staff-line collisions in.",
59 "direction dot-count");