On Wed, 11 Oct 2006, Han-Wen Nienhuys wrote:

why not simply do

 string style =""
 if (scm_is_symbol (scm_style))
   style = ly_symbol2string (scm_style);
 string idx =  "dots.dot" + style;



Because, historically, there is no difference in lily's behaviour between setting style to #'default and #'(). However, if you do not mind, I am also happy with the simpler solution.

Attached is a revised version that issues a proper warning if style is set to #'default or some other unsupported value, such that the dot is not found.

Should I apply it?

Greetings,
Juergen
Index: ChangeLog
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ChangeLog,v
retrieving revision 1.5395
diff -u -r1.5395 ChangeLog
--- ChangeLog   10 Oct 2006 13:38:32 -0000      1.5395
+++ ChangeLog   11 Oct 2006 10:03:50 -0000
@@ -1,3 +1,10 @@
+2006-10-10  Jürgen Reuter  <[EMAIL PROTECTED]>
+
+       * mf/parmesan-dots.mf (new), mf/parmesan-generic.mf,
+       ly/engraver-init.ly: Added vaticana-style augmentum dot glyph.
+
+       * lily/dots.cc: Added style property for dots.
+
 2006-10-10  Han-Wen Nienhuys  <[EMAIL PROTECTED]>
 
        * scm/output-lib.scm (fingering::calc-text): use origin
Index: lily/dots.cc
===================================================================
RCS file: /cvsroot/lilypond/lilypond/lily/dots.cc,v
retrieving revision 1.79
diff -u -r1.79 dots.cc
--- lily/dots.cc        11 Feb 2006 11:35:18 -0000      1.79
+++ lily/dots.cc        11 Oct 2006 10:03:50 -0000
@@ -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 @@
 
   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 ();
 
       /*
@@ -55,5 +66,6 @@
 
               /* properties */
               "direction "
-              "dot-count");
-
+              "dot-count "
+              "style "
+              );
Index: mf/parmesan-generic.mf
===================================================================
RCS file: /cvsroot/lilypond/lilypond/mf/parmesan-generic.mf,v
retrieving revision 1.10
diff -u -r1.10 parmesan-generic.mf
--- mf/parmesan-generic.mf      6 Jan 2006 09:13:23 -0000       1.10
+++ mf/parmesan-generic.mf      11 Oct 2006 10:03:50 -0000
@@ -33,6 +33,7 @@
        input parmesan-flags;
        input parmesan-timesig;
        input parmesan-scripts;
+       input parmesan-dots;
 else:
 
 fi
Index: ly/engraver-init.ly
===================================================================
RCS file: /cvsroot/lilypond/lilypond/ly/engraver-init.ly,v
retrieving revision 1.309
diff -u -r1.309 engraver-init.ly
--- ly/engraver-init.ly 4 Oct 2006 10:32:26 -0000       1.309
+++ ly/engraver-init.ly 11 Oct 2006 10:03:50 -0000
@@ -765,6 +765,7 @@
   \override Custos #'style = #'vaticana
   \override Custos #'neutral-position = #3
   \override Custos #'neutral-direction = #DOWN
+  \override Dots #'style = #'vaticana
 }
 
 \context {
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to