]> 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 0627b2b7201a2f3fe6aa10f3cc4b8fe1ebb61d7a..afa82868a83f95afb6a4b8fc86462593f93ab087 100644 (file)
@@ -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 (std::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,12 +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.",
 
               /* properties */
               "direction "
-              "dot-count");
-
+              "dot-count "
+              "style "
+              );