]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/dots.cc
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[lilypond.git] / lily / dots.cc
index a6f2e64a5c750126bd504711f62b17c33ff3f3e5..afa82868a83f95afb6a4b8fc86462593f93ab087 100644 (file)
@@ -3,7 +3,7 @@
 
   source file of the GNU LilyPond music typesetter
 
-  (c) 1997--2005 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+  (c) 1997--2006 Han-Wen Nienhuys <hanwen@xs4all.nl>
 */
 
 #include "dots.hh"
@@ -14,6 +14,7 @@
 #include "lookup.hh"
 #include "staff-symbol-referencer.hh"
 #include "directional-element-interface.hh"
+#include "international.hh"
 
 MAKE_SCHEME_CALLBACK (Dots, print, 1);
 SCM
@@ -26,7 +27,17 @@ Dots::print (SCM d)
 
   if (scm_is_number (c))
     {
-      Stencil d = Font_interface::get_default_font (sc)->find_by_name (String ("dots.dot"));
+      SCM scm_style = sc->get_property ("style");
+      string style ="";
+      if (scm_is_symbol (scm_style))
+       style = ly_symbol2string (scm_style);
+      string idx =  "dots.dot" + style;
+      Stencil d = Font_interface::get_default_font (sc)->find_by_name (idx);
+      if (d.is_empty ())
+       {
+         sc->warning (_f ("dot `%s' not found", idx.c_str ()));
+         return SCM_EOL;
+       }
       Real dw = d.extent (X_AXIS).length ();
 
       /*
@@ -48,9 +59,13 @@ Dots::print (SCM d)
   return mol.smobbed_copy ();
 }
 
-ADD_INTERFACE (Dots, "dots-interface",
+ADD_INTERFACE (Dots,
               "The dots to go with a notehead or rest."
               "@code{direction} sets the preferred direction to move in case of staff "
               "line collisions.",
-              "direction dot-count");
 
+              /* properties */
+              "direction "
+              "dot-count "
+              "style "
+              );